Java 类org.bouncycastle.asn1.isismtt.ocsp.CertHash 实例源码

项目:gwt-crypto    文件:CertHashUnitTest.java   
private void checkConstruction(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
    throws IOException
{
    checkValues(certHash, algId, digest);

    certHash = CertHash.getInstance(certHash);

    checkValues(certHash, algId, digest);

    ASN1InputStream aIn = new ASN1InputStream(certHash.toASN1Primitive().getEncoded());

    ASN1Sequence seq = (ASN1Sequence)aIn.readObject();

    certHash = CertHash.getInstance(seq);

    checkValues(certHash, algId, digest);
}
项目:irma_future_id    文件:CertHashUnitTest.java   
private void checkConstruction(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
    throws IOException
{
    checkValues(certHash, algId, digest);

    certHash = CertHash.getInstance(certHash);

    checkValues(certHash, algId, digest);

    ASN1InputStream aIn = new ASN1InputStream(certHash.toASN1Object().getEncoded());

    ASN1Sequence seq = (ASN1Sequence)aIn.readObject();

    certHash = CertHash.getInstance(seq);

    checkValues(certHash, algId, digest);
}
项目:bc-java    文件:CertHashUnitTest.java   
private void checkConstruction(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
    throws IOException
{
    checkValues(certHash, algId, digest);

    certHash = CertHash.getInstance(certHash);

    checkValues(certHash, algId, digest);

    ASN1InputStream aIn = new ASN1InputStream(certHash.toASN1Object().getEncoded());

    ASN1Sequence seq = (ASN1Sequence)aIn.readObject();

    certHash = CertHash.getInstance(seq);

    checkValues(certHash, algId, digest);
}
项目:gwt-crypto    文件:CertHashUnitTest.java   
public void performTest()
    throws Exception
{
    AlgorithmIdentifier algId = new AlgorithmIdentifier(new ASN1ObjectIdentifier("1.2.2.3"));
    byte[]              digest = new byte[20];

    CertHash certID = new CertHash(algId, digest);

    checkConstruction(certID, algId, digest);

    certID = CertHash.getInstance(null);

    if (certID != null)
    {
        fail("null getInstance() failed.");
    }

    try
    {
        CertHash.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:gwt-crypto    文件:CertHashUnitTest.java   
private void checkValues(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
{
    checkMandatoryField("algorithmHash", algId, certHash.getHashAlgorithm());

    checkMandatoryField("certificateHash", digest, certHash.getCertificateHash());
}
项目:irma_future_id    文件:CertHashUnitTest.java   
public void performTest()
    throws Exception
{
    AlgorithmIdentifier algId = new AlgorithmIdentifier(new DERObjectIdentifier("1.2.2.3"));
    byte[]              digest = new byte[20];

    CertHash certID = new CertHash(algId, digest);

    checkConstruction(certID, algId, digest);

    certID = CertHash.getInstance(null);

    if (certID != null)
    {
        fail("null getInstance() failed.");
    }

    try
    {
        CertHash.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:irma_future_id    文件:CertHashUnitTest.java   
private void checkValues(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
{
    checkMandatoryField("algorithmHash", algId, certHash.getHashAlgorithm());

    checkMandatoryField("certificateHash", digest, certHash.getCertificateHash());
}
项目:bc-java    文件:CertHashUnitTest.java   
public void performTest()
    throws Exception
{
    AlgorithmIdentifier algId = new AlgorithmIdentifier(new DERObjectIdentifier("1.2.2.3"));
    byte[]              digest = new byte[20];

    CertHash certID = new CertHash(algId, digest);

    checkConstruction(certID, algId, digest);

    certID = CertHash.getInstance(null);

    if (certID != null)
    {
        fail("null getInstance() failed.");
    }

    try
    {
        CertHash.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:bc-java    文件:CertHashUnitTest.java   
private void checkValues(
    CertHash certHash,
    AlgorithmIdentifier algId,
    byte[] digest)
{
    checkMandatoryField("algorithmHash", algId, certHash.getHashAlgorithm());

    checkMandatoryField("certificateHash", digest, certHash.getCertificateHash());
}