Java 类org.bouncycastle.crypto.ExtendedDigest 实例源码

项目:keepass2android    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:ipack    文件:PKCS12PBEUtils.java   
static CipherParameters createCipherParameters(ASN1ObjectIdentifier algorithm, ExtendedDigest digest, int blockSize, PKCS12PBEParams pbeParams, char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    CipherParameters params;

    if (PKCS12PBEUtils.hasNoIv(algorithm))
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm));
    }
    else
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm), blockSize * 8);

        if (PKCS12PBEUtils.isDesAlg(algorithm))
        {
            DESedeParameters.setOddParity(((KeyParameter)((ParametersWithIV)params).getParameters()).getKey());
        }
    }
    return params;
}
项目:ipack    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:ipack    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:KeePass2Android    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:gwt-crypto    文件:PKCS12PBEUtils.java   
static CipherParameters createCipherParameters(ASN1ObjectIdentifier algorithm, ExtendedDigest digest, int blockSize, PKCS12PBEParams pbeParams, char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    CipherParameters params;

    if (PKCS12PBEUtils.hasNoIv(algorithm))
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm));
    }
    else
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm), blockSize * 8);

        if (PKCS12PBEUtils.isDesAlg(algorithm))
        {
            DESedeParameters.setOddParity(((KeyParameter)((ParametersWithIV)params).getParameters()).getKey());
        }
    }
    return params;
}
项目:gwt-crypto    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:gwt-crypto    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:Aki-SSL    文件:PKCS12PBEUtils.java   
static CipherParameters createCipherParameters(ASN1ObjectIdentifier algorithm, ExtendedDigest digest, int blockSize, PKCS12PBEParams pbeParams, char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    CipherParameters params;

    if (PKCS12PBEUtils.hasNoIv(algorithm))
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm));
    }
    else
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm), blockSize * 8);

        if (PKCS12PBEUtils.isDesAlg(algorithm))
        {
            DESedeParameters.setOddParity(((KeyParameter)((ParametersWithIV)params).getParameters()).getKey());
        }
    }
    return params;
}
项目:Aki-SSL    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:Aki-SSL    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:TinyTravelTracker    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:TinyTravelTracker    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:CryptMeme    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:CryptMeme    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:google-authenticator    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:irma_future_id    文件:PKCS12PBEUtils.java   
static CipherParameters createCipherParameters(ASN1ObjectIdentifier algorithm, ExtendedDigest digest, int blockSize, PKCS12PBEParams pbeParams, char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    CipherParameters params;

    if (PKCS12PBEUtils.hasNoIv(algorithm))
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm));
    }
    else
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm), blockSize * 8);

        if (PKCS12PBEUtils.isDesAlg(algorithm))
        {
            DESedeParameters.setOddParity(((KeyParameter)((ParametersWithIV)params).getParameters()).getKey());
        }
    }
    return params;
}
项目:irma_future_id    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:irma_future_id    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:bc-java    文件:PKCS12PBEUtils.java   
static CipherParameters createCipherParameters(ASN1ObjectIdentifier algorithm, ExtendedDigest digest, int blockSize, PKCS12PBEParams pbeParams, char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    CipherParameters params;

    if (PKCS12PBEUtils.hasNoIv(algorithm))
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm));
    }
    else
    {
        params = pGen.generateDerivedParameters(PKCS12PBEUtils.getKeySize(algorithm), blockSize * 8);

        if (PKCS12PBEUtils.isDesAlg(algorithm))
        {
            DESedeParameters.setOddParity(((KeyParameter)((ParametersWithIV)params).getParameters()).getKey());
        }
    }
    return params;
}
项目:bc-java    文件:HMac.java   
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }

    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());

    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }

    return b.intValue();
}
项目:bc-java    文件:ShortenedDigest.java   
/**
 * Base constructor.
 * 
 * @param baseDigest underlying digest to use.
 * @param length length in bytes of the output of doFinal.
 * @exception IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().
 */
public ShortenedDigest(
    ExtendedDigest baseDigest,
    int            length)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    if (length > baseDigest.getDigestSize())
    {
        throw new IllegalArgumentException("baseDigest output not large enough to support length");
    }

    this.baseDigest = baseDigest;
    this.length = length;
}
项目:keepass2android    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:ipack    文件:BcDefaultDigestProvider.java   
public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier)
    throws OperatorCreationException
{
    BcDigestProvider extProv = (BcDigestProvider)lookup.get(digestAlgorithmIdentifier.getAlgorithm());

    if (extProv == null)
    {
        throw new OperatorCreationException("cannot recognise digest");
    }

    return extProv.get(digestAlgorithmIdentifier);
}
项目:ipack    文件:PKCS12PBEUtils.java   
static MacCalculator createMacCalculator(final ASN1ObjectIdentifier digestAlgorithm, ExtendedDigest digest, final PKCS12PBEParams pbeParams, final char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    final KeyParameter keyParam = (KeyParameter)pGen.generateDerivedMacParameters(digest.getDigestSize() * 8);

    final HMac hMac = new HMac(digest);

    hMac.init(keyParam);

    return new MacCalculator()
    {
        public AlgorithmIdentifier getAlgorithmIdentifier()
        {
            return new AlgorithmIdentifier(digestAlgorithm, pbeParams);
        }

        public OutputStream getOutputStream()
        {
            return new MacOutputStream(hMac);
        }

        public byte[] getMac()
        {
            byte[] res = new byte[hMac.getMacSize()];

            hMac.doFinal(res, 0);

            return res;
        }

        public GenericKey getKey()
        {
            return new GenericKey(getAlgorithmIdentifier(), PKCS12ParametersGenerator.PKCS12PasswordToBytes(password));
        }
    };
}
项目:ipack    文件:NonMemoableDigest.java   
/**
 * Base constructor.
 *
 * @param baseDigest underlying digest to use.
 * @exception IllegalArgumentException if baseDigest is null
 */
public NonMemoableDigest(
    ExtendedDigest baseDigest)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    this.baseDigest = baseDigest;
}
项目:ipack    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:KeePass2Android    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:gwt-crypto    文件:BcDefaultDigestProvider.java   
public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier)
    throws OperatorCreationException
{
    BcDigestProvider extProv = (BcDigestProvider)lookup.get(digestAlgorithmIdentifier.getAlgorithm());

    if (extProv == null)
    {
        throw new OperatorCreationException("cannot recognise digest");
    }

    return extProv.get(digestAlgorithmIdentifier);
}
项目:gwt-crypto    文件:PKCS12PBEUtils.java   
static MacCalculator createMacCalculator(final ASN1ObjectIdentifier digestAlgorithm, ExtendedDigest digest, final PKCS12PBEParams pbeParams, final char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    final KeyParameter keyParam = (KeyParameter)pGen.generateDerivedMacParameters(digest.getDigestSize() * 8);

    final HMac hMac = new HMac(digest);

    hMac.init(keyParam);

    return new MacCalculator()
    {
        public AlgorithmIdentifier getAlgorithmIdentifier()
        {
            return new AlgorithmIdentifier(digestAlgorithm, pbeParams);
        }

        public OutputStream getOutputStream()
        {
            return new MacOutputStream(hMac);
        }

        public byte[] getMac()
        {
            byte[] res = new byte[hMac.getMacSize()];

            hMac.doFinal(res, 0);

            return res;
        }

        public GenericKey getKey()
        {
            return new GenericKey(getAlgorithmIdentifier(), PKCS12ParametersGenerator.PKCS12PasswordToBytes(password));
        }
    };
}
项目:gwt-crypto    文件:NonMemoableDigest.java   
/**
 * Base constructor.
 *
 * @param baseDigest underlying digest to use.
 * @exception IllegalArgumentException if baseDigest is null
 */
public NonMemoableDigest(
    ExtendedDigest baseDigest)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    this.baseDigest = baseDigest;
}
项目:gwt-crypto    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:Aki-SSL    文件:BcDefaultDigestProvider.java   
public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier)
    throws OperatorCreationException
{
    BcDigestProvider extProv = (BcDigestProvider)lookup.get(digestAlgorithmIdentifier.getAlgorithm());

    if (extProv == null)
    {
        throw new OperatorCreationException("cannot recognise digest");
    }

    return extProv.get(digestAlgorithmIdentifier);
}
项目:Aki-SSL    文件:PKCS12PBEUtils.java   
static MacCalculator createMacCalculator(final ASN1ObjectIdentifier digestAlgorithm, ExtendedDigest digest, final PKCS12PBEParams pbeParams, final char[] password)
{
    PKCS12ParametersGenerator pGen = new PKCS12ParametersGenerator(digest);

    pGen.init(PKCS12ParametersGenerator.PKCS12PasswordToBytes(password), pbeParams.getIV(), pbeParams.getIterations().intValue());

    final KeyParameter keyParam = (KeyParameter)pGen.generateDerivedMacParameters(digest.getDigestSize() * 8);

    final HMac hMac = new HMac(digest);

    hMac.init(keyParam);

    return new MacCalculator()
    {
        public AlgorithmIdentifier getAlgorithmIdentifier()
        {
            return new AlgorithmIdentifier(digestAlgorithm, pbeParams);
        }

        public OutputStream getOutputStream()
        {
            return new MacOutputStream(hMac);
        }

        public byte[] getMac()
        {
            byte[] res = new byte[hMac.getMacSize()];

            hMac.doFinal(res, 0);

            return res;
        }

        public GenericKey getKey()
        {
            return new GenericKey(getAlgorithmIdentifier(), PKCS12ParametersGenerator.PKCS12PasswordToBytes(password));
        }
    };
}
项目:Aki-SSL    文件:NonMemoableDigest.java   
/**
 * Base constructor.
 *
 * @param baseDigest underlying digest to use.
 * @exception IllegalArgumentException if baseDigest is null
 */
public NonMemoableDigest(
    ExtendedDigest baseDigest)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    this.baseDigest = baseDigest;
}
项目:Aki-SSL    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:TinyTravelTracker    文件:NonMemoableDigest.java   
/**
 * Base constructor.
 *
 * @param baseDigest underlying digest to use.
 * @exception IllegalArgumentException if baseDigest is null
 */
public NonMemoableDigest(
    ExtendedDigest baseDigest)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    this.baseDigest = baseDigest;
}
项目:TinyTravelTracker    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
项目:CryptMeme    文件:NonMemoableDigest.java   
/**
 * Base constructor.
 *
 * @param baseDigest underlying digest to use.
 * @exception IllegalArgumentException if baseDigest is null
 */
public NonMemoableDigest(
    ExtendedDigest baseDigest)
{
    if (baseDigest == null)
    {
        throw new IllegalArgumentException("baseDigest must not be null");
    }

    this.baseDigest = baseDigest;
}
项目:CryptMeme    文件:PKCS12ParametersGenerator.java   
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}