Package java.security.cert

Examples of java.security.cert.PolicyQualifierInfo


        byte[] encoding = getDerEncoding();
        // get policy qualifier encoding
        byte[] pqEncoding = new byte[28];
        System.arraycopy(encoding, 12, pqEncoding, 0, pqEncoding.length);
        // pass valid array
        PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
        // get encoding
        byte[] pqEncodingRet = i.getPolicyQualifier();
        // check returned array
        assertTrue(Arrays.equals(pqEncoding, pqEncodingRet));
    }
View Full Code Here


        byte[] encoding = getDerEncoding();
        // get policy qualifier encoding
        byte[] pqEncoding = new byte[28];
        System.arraycopy(encoding, 12, pqEncoding, 0, pqEncoding.length);
        // pass valid array
        PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
        // get encoding
        byte[] pqEncodingRet = i.getPolicyQualifier();
        // modify returned array
        pqEncodingRet[0] = (byte)0;
        // get encoding again
        byte[] pqEncodingRet1 = i.getPolicyQualifier();
        //
        assertNotSame(pqEncodingRet, pqEncodingRet1);
        // check that above modification did not change
        // internal state of the PolicyQualifierInfo instance
        assertTrue(Arrays.equals(pqEncoding, pqEncodingRet1));
View Full Code Here

     */
    public final void testGetPolicyQualifierId() throws IOException {
        // get valid encoding
        byte[] encoding = getDerEncoding();
        // pass valid array
        PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
        // get OID as String and check it
        assertEquals("1.3.6.1.5.5.7.2.1", i.getPolicyQualifierId());

        // get valid encoding
        encoding = getDerEncoding();
        // change OID to 1.3.98437.82818.1
        encoding[5] = (byte)0x86;
        encoding[6] = (byte)0x81;
        encoding[8] = (byte)0x85;
        encoding[9] = (byte)0x87;
        i = new PolicyQualifierInfo(encoding);
        // get OID as String and check it
        assertEquals("1.3.98437.82818.1", i.getPolicyQualifierId());
    }
View Full Code Here

     */
    public final void testToString() throws IOException {
        // get valid encoding
        byte[] encoding = getDerEncoding();
        // pass valid array
        PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);

        assertNotNull(i.toString());
    }
View Full Code Here

            if (opt.tag != DerValue.tag_Sequence)
                throw new IOException("Invalid encoding of PolicyInformation");
            if (opt.data.available() == 0)
                throw new IOException("No data available in policyQualifiers");
            while (opt.data.available() != 0)
                policyQualifiers.add(new PolicyQualifierInfo
                        (opt.data.getDerValue().toByteArray()));
        } else {
            policyQualifiers = Collections.emptySet();
        }
    }
View Full Code Here

        {
            try
            {
                aOut.writeObject(e.nextElement());
   
                pq.add(new PolicyQualifierInfo(bOut.toByteArray()));
            }
            catch (IOException ex)
            {
                throw new ExtCertPathValidatorException("Policy qualifier info cannot be decoded.", ex);
            }
View Full Code Here

        {
            try
            {
                aOut.writeObject(e.nextElement());
   
                pq.add(new PolicyQualifierInfo(bOut.toByteArray()));
            }
            catch (IOException ex)
            {
                throw new ExtCertPathValidatorException("Policy qualifier info cannot be decoded.", ex);
            }
View Full Code Here

        {
            try
            {
                aOut.writeObject(e.nextElement());
   
                pq.add(new PolicyQualifierInfo(bOut.toByteArray()));
            }
            catch (IOException ex)
            {
                throw new CertPathValidatorException("exception building qualifier set: " + ex);
            }
View Full Code Here

TOP

Related Classes of java.security.cert.PolicyQualifierInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.