⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 combinedhash.java

📁 kmlnjlkj nlkjlkjkljl okopokipoipo oipipipo i
💻 JAVA
字号:
package org.bouncycastle.crypto.tls;import org.bouncycastle.crypto.Digest;import org.bouncycastle.crypto.digests.MD5Digest;import org.bouncycastle.crypto.digests.SHA1Digest;/** * A combined hash, which implements md5(m) || sha1(m). */public class CombinedHash implements Digest{    private Digest md5 = new MD5Digest();    private Digest sha1 = new SHA1Digest();    /**     * @see org.bouncycastle.crypto.Digest#getAlgorithmName()     */    public String getAlgorithmName()    {        return md5.getAlgorithmName() + " and " + sha1.getAlgorithmName() + " for TLS 1.0";    }    /**     * @see org.bouncycastle.crypto.Digest#getDigestSize()     */    public int getDigestSize()    {        return 16 + 20;    }    /**     * @see org.bouncycastle.crypto.Digest#update(byte)     */    public void update(byte in)    {        md5.update(in);        sha1.update(in);    }    /**     * @see org.bouncycastle.crypto.Digest#update(byte[],int,int)     */    public void update(byte[] in, int inOff, int len)    {        md5.update(in, inOff, len);        sha1.update(in, inOff, len);    }    /**     * @see org.bouncycastle.crypto.Digest#doFinal(byte[],int)     */    public int doFinal(byte[] out, int outOff)    {        int i1 = md5.doFinal(out, outOff);        int i2 = sha1.doFinal(out, outOff + 16);        return i1 + i2;    }    /**     * @see org.bouncycastle.crypto.Digest#reset()     */    public void reset()    {        md5.reset();        sha1.reset();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -