Search in sources :

Example 21 with AndroidOnly

use of dalvik.annotation.AndroidOnly in project robovm by robovm.

the class X509CRLSelector2Test method testSetMaxCRLNumberLjava_math_BigInteger.

/**
     * setMaxCRLNumber(BigInteger maxCRL) method testing. Tests if CRLs with any
     * crl number value match the selector in the case of null crlNumber
     * criteria, if specified maxCRL value matches the selector, and if CRL with
     * inappropriate crlNumber value does not match the selector.
     */
@AndroidOnly("Uses specific class: " + "org.apache.harmony.security.asn1.ASN1OctetString.")
public void testSetMaxCRLNumberLjava_math_BigInteger() {
    X509CRLSelector selector = new X509CRLSelector();
    BigInteger maxCRL = new BigInteger("10000");
    TestCRL crl = new TestCRL(maxCRL);
    selector.setMaxCRLNumber(null);
    assertTrue("Any CRL should match in the case of null minCRLNumber.", selector.match(crl));
    selector.setMaxCRLNumber(maxCRL);
    assertTrue("The CRL should match the selection criteria.", selector.match(crl));
    selector.setMaxCRLNumber(new BigInteger("9999"));
    assertFalse("The CRL should not match the selection criteria.", selector.match(crl));
}
Also used : BigInteger(java.math.BigInteger) X509CRLSelector(java.security.cert.X509CRLSelector) AndroidOnly(dalvik.annotation.AndroidOnly)

Aggregations

AndroidOnly (dalvik.annotation.AndroidOnly)21 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)10 IOException (java.io.IOException)7 KeyManagementException (java.security.KeyManagementException)7 SSLEngine (javax.net.ssl.SSLEngine)7 ByteBuffer (java.nio.ByteBuffer)6 ReadOnlyBufferException (java.nio.ReadOnlyBufferException)6 SSLException (javax.net.ssl.SSLException)6 BigInteger (java.math.BigInteger)3 Provider (java.security.Provider)3 CertificateFactory (java.security.cert.CertificateFactory)3 X509CRLSelector (java.security.cert.X509CRLSelector)3 X509Certificate (java.security.cert.X509Certificate)3 MessageDigest (java.security.MessageDigest)2 Signature (java.security.Signature)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InvalidKeyException (java.security.InvalidKeyException)1 NoSuchProviderException (java.security.NoSuchProviderException)1 SignatureException (java.security.SignatureException)1 CRL (java.security.cert.CRL)1