Java 类org.bouncycastle.crypto.digests.NullDigest 实例源码

项目:gwt-crypto    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null && algorithm.getSignature() != getSignatureAlgorithm())
    {
        throw new IllegalStateException();
    }

    short hashAlgorithm = algorithm == null ? HashAlgorithm.sha1 : algorithm.getHash();
    Digest d = raw ? new NullDigest() : TlsUtils.createHash(hashAlgorithm);

    Signer s = new DSADigestSigner(createDSAImpl(hashAlgorithm), d);
    s.init(forSigning, makeInitParameters(forSigning, cp));
    return s;
}
项目:Aki-SSL    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null && algorithm.getSignature() != getSignatureAlgorithm())
    {
        throw new IllegalStateException();
    }

    short hashAlgorithm = algorithm == null ? HashAlgorithm.sha1 : algorithm.getHash();
    Digest d = raw ? new NullDigest() : TlsUtils.createHash(hashAlgorithm);

    Signer s = new DSADigestSigner(createDSAImpl(hashAlgorithm), d);
    s.init(forSigning, makeInitParameters(forSigning, cp));
    return s;
}
项目:TinyTravelTracker    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null && algorithm.getSignature() != getSignatureAlgorithm())
    {
        throw new IllegalStateException();
    }

    short hashAlgorithm = algorithm == null ? HashAlgorithm.sha1 : algorithm.getHash();
    Digest d = raw ? new NullDigest() : TlsUtils.createHash(hashAlgorithm);

    Signer s = new DSADigestSigner(createDSAImpl(hashAlgorithm), d);
    s.init(forSigning, makeInitParameters(forSigning, cp));
    return s;
}
项目:CryptMeme    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null
        && (algorithm.getHash() != HashAlgorithm.sha1 || algorithm.getSignature() != getSignatureAlgorithm()))
    {
        throw new IllegalStateException();
    }

    Digest d = raw ? new NullDigest() : TlsUtils.createHash(HashAlgorithm.sha1);

    Signer s = new DSADigestSigner(createDSAImpl(), d);
    s.init(forSigning, cp);
    return s;
}
项目:irma_future_id    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null
        && (algorithm.getHash() != HashAlgorithm.sha1 || algorithm.getSignature() != getSignatureAlgorithm()))
    {
        throw new IllegalStateException();
    }

    Digest d = raw ? new NullDigest() : TlsUtils.createHash(HashAlgorithm.sha1);

    Signer s = new DSADigestSigner(createDSAImpl(), d);
    s.init(forSigning, cp);
    return s;
}
项目:bc-java    文件:TlsDSASigner.java   
protected Signer makeSigner(SignatureAndHashAlgorithm algorithm, boolean raw, boolean forSigning,
    CipherParameters cp)
{
    if ((algorithm != null) != TlsUtils.isTLSv12(context))
    {
        throw new IllegalStateException();
    }

    if (algorithm != null
        && (algorithm.getHash() != HashAlgorithm.sha1 || algorithm.getSignature() != getSignatureAlgorithm()))
    {
        throw new IllegalStateException();
    }

    Digest d = raw ? new NullDigest() : TlsUtils.createHash(HashAlgorithm.sha1);

    Signer s = new DSADigestSigner(createDSAImpl(), d);
    s.init(forSigning, cp);
    return s;
}
项目:ipack    文件:TlsDSASigner.java   
public byte[] generateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5AndSha1)
    throws CryptoException
{

    // Note: Only use the SHA1 part of the hash
    Signer signer = makeSigner(new NullDigest(), true,
        new ParametersWithRandom(privateKey, this.context.getSecureRandom()));
    signer.update(md5AndSha1, 16, 20);
    return signer.generateSignature();
}
项目:ipack    文件:TlsDSASigner.java   
public boolean verifyRawSignature(byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] md5AndSha1)
    throws CryptoException
{

    // Note: Only use the SHA1 part of the hash
    Signer signer = makeSigner(new NullDigest(), false, publicKey);
    signer.update(md5AndSha1, 16, 20);
    return signer.verifySignature(sigBytes);
}
项目:Oberien    文件:CustomECDSASigner.java   
@Override
protected Signer makeSigner(SignatureAndHashAlgorithm signatureAndHashAlgorithm, boolean raw, boolean forSigning, CipherParameters cipherParameters) {
    if (!TlsUtils.isTLSv12(context)) {
        throw new IllegalStateException("Impossible");
    }
    Digest d = raw ? new NullDigest() : TlsUtils.createHash(HashAlgorithm.sha256);
    Signer s = new DSADigestSigner(createDSAImpl(HashAlgorithm.sha256), d);
    s.init(forSigning, makeInitParameters(forSigning, cipherParameters));
    return s;
}
项目:jradius    文件:TlsDSSSigner.java   
public byte[] calculateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5andsha1)
    throws CryptoException
{
    // Note: Only use the SHA1 part of the hash
    Signer sig = new DSADigestSigner(new DSASigner(), new NullDigest());
    sig.init(true, privateKey);
    sig.update(md5andsha1, 16, 20);
    return sig.generateSignature();
}
项目:jradius    文件:TlsRSASigner.java   
public byte[] calculateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5andsha1)
    throws CryptoException
{
    Signer sig = new GenericSigner(new PKCS1Encoding(new RSABlindedEngine()), new NullDigest());
    sig.init(true, privateKey);
    sig.update(md5andsha1, 0, md5andsha1.length);
    return sig.generateSignature();
}
项目:ipack    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:ipack    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:ipack    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:xitk    文件:P11RSADigestSignatureSpi.java   
public NoneRSA() {
    super(new NullDigest());
}
项目:Aki-SSL    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:Aki-SSL    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:CryptMeme    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:irma_future_id    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:irma_future_id    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:bc-java    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:bc-java    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}
项目:bc-java    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecDSAnone()
{
    super(new NullDigest(), new ECDSASigner(), new StdDSAEncoder());
}
项目:bc-java    文件:DSASigner.java   
public noneDSA()
{
    super(new NullDigest(), new org.bouncycastle.crypto.signers.DSASigner());
}
项目:bc-java    文件:DigestSignatureSpi.java   
public noneRSA()
{
    super(new NullDigest(), new PKCS1Encoding(new RSABlindedEngine()));
}