Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.ASN1Encodable


        this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
        this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));

        for (int i = 7; i < seq.size(); i++)
        {
            ASN1Encodable    obj = (ASN1Encodable)seq.getObjectAt(i);

            if (obj instanceof DERBitString)
            {
                this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
            }
View Full Code Here


        this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
        this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));

        for (int i = 7; i < seq.size(); i++)
        {
            ASN1Encodable    obj = (ASN1Encodable)seq.getObjectAt(i);

            if (obj instanceof DERBitString)
            {
                this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
            }
View Full Code Here

        this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
        this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));

        for (int i = 7; i < seq.size(); i++)
        {
            ASN1Encodable    obj = (ASN1Encodable)seq.getObjectAt(i);

            if (obj instanceof DERBitString)
            {
                this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
            }
View Full Code Here

    }

    public void abandon(final int messageId, Control[] controls)
            throws IOException {
        doOperationWithoutResponse(LdapASN1Constant.OP_ABANDON_REQUEST,
                new ASN1Encodable() {

                    public void encodeValues(Object[] values) {
                        values[0] = ASN1Integer.fromIntValue(messageId);
                    }
View Full Code Here

        DirContext context = new InitialDirContext(env);

        final MockLdapServer referralServer = new MockLdapServer();
        referralServer.start();

        ASN1Encodable ref = new ASN1Encodable() {

            public void encodeValues(Object[] values) {
                List<byte[]> list = new ArrayList<byte[]>();
                list.add(Utils.getBytes(referralServer.getURL()));
                values[0] = list;
View Full Code Here

    }

    public void abandon(final int messageId, Control[] controls)
            throws IOException {
        doOperationWithoutResponse(LdapASN1Constant.OP_ABANDON_REQUEST,
                new ASN1Encodable() {

                    public void encodeValues(Object[] values) {
                        values[0] = ASN1Integer.fromIntValue(messageId);
                    }
View Full Code Here

        DirContext context = new InitialDirContext(env);

        final MockLdapServer referralServer = new MockLdapServer();
        referralServer.start();

        ASN1Encodable ref = new ASN1Encodable() {

            public void encodeValues(Object[] values) {
                List<byte[]> list = new ArrayList<byte[]>();
                list.add(Utils.getBytes(referralServer.getURL()));
                values[0] = list;
View Full Code Here

    public void testExtendedOperation() throws Exception {
        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        LdapContext context = new InitialLdapContext(env, null);

        ASN1Encodable encodableResponse = new ASN1Encodable() {

            public void encodeValues(Object[] values) {
                new EncodableLdapResult().encodeValues(values);
                values[4] = Utils.getBytes("It's my id");
                values[5] = new byte[] { 0, 1, 2, 3 };
            }

        };
        server
                .setResponseSeq(new LdapMessage[] { new LdapMessage(
                        LdapASN1Constant.OP_EXTENDED_RESPONSE,
                        encodableResponse, null) });

        ExtendedResponse response = context
                .extendedOperation(new MockExtendedRequest());
        assertTrue(response instanceof MockExtendedResponse);
        assertEquals("It's my id", response.getID());
        assertEquals(4, response.getEncodedValue().length);
        assertEquals(0, response.getEncodedValue()[0]);
        assertEquals(1, response.getEncodedValue()[1]);
        assertEquals(2, response.getEncodedValue()[2]);
        assertEquals(3, response.getEncodedValue()[3]);

        // test exception
        encodableResponse = new ASN1Encodable() {
            public void encodeValues(Object[] values) {
                new EncodableLdapResult().encodeValues(values);
                values[4] = Utils.getBytes("exception");
                values[5] = new byte[] { 0, 1, 2, 3 };
            }
View Full Code Here

            authChoice = new AuthenticationChoice(1, saslCreds);
        }
    }

    public ASN1Encodable getRequest() {
        return new ASN1Encodable() {
            public void encodeValues(Object[] values) {
                values[0] = ASN1Integer.fromIntValue(3);
                values[1] = Utils.getBytes(name);
                values[2] = authChoice;
            }
View Full Code Here

    }

    public void abandon(final int messageId, Control[] controls)
            throws IOException {
        doOperationWithoutResponse(LdapASN1Constant.OP_ABANDON_REQUEST,
                new ASN1Encodable() {

                    public void encodeValues(Object[] values) {
                        values[0] = ASN1Integer.fromIntValue(messageId);
                    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.ASN1Encodable

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.