Examples of CertGenerationContainer


Examples of org.apache.directory.shared.ldap.codec.extended.operations.certGeneration.CertGenerationContainer

    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
    {
        ByteBuffer bb = ByteBuffer.wrap( req.getPayload() );
        Asn1Decoder decoder = new CertGenerationDecoder();
        CertGenerationContainer container = new CertGenerationContainer();
       
        try
        {
            decoder.decode( bb, container );
        }
        catch( DecoderException e )
        {
            throw e;
        }
       
        CertGenerationObject certGenObj = container.getCertGenerationObject();
       
        ClonedServerEntry entry = session.getCoreSession().lookup( new DN( certGenObj.getTargetDN() ) );
        if( entry != null )
        {
            TlsKeyGenerator.addKeyPair( entry.getOriginalEntry(), certGenObj.getIssuerDN(), certGenObj.getSubjectDN(), certGenObj.getKeyAlgorithm() );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x04, 0x03, 'R', 'S', 'A' } );

        String decodedPdu = Strings.dumpBytes( bb.array() );
        bb.flip();

        CertGenerationContainer container = new CertGenerationContainer();
        try
        {
            decoder.decode( bb, container );
        }
        catch ( DecoderException e )
        {
            fail( e.getMessage() );
        }

        CertGenerationRequestDecorator req = new CertGenerationRequestDecorator(
            LdapCodecServiceFactory.getSingleton(), new CertGenerationRequestImpl() );
        req = container.getCertGenerationObject();
        assertEquals( dn, req.getTargetDN() );
        assertEquals( dn, req.getIssuerDN() );
        assertEquals( dn, req.getSubjectDN() );
        assertEquals( keyAlgo, req.getKeyAlgorithm() );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x30, 0x03, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x01, ' ' } ); // empty targetDN value

        bb.flip();

        CertGenerationContainer container = new CertGenerationContainer();

        try
        {
            decoder.decode( bb, container );
            fail( "shouldn't accept the empty targetDN" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

        bb.put( new byte[]
            { 0x30, 0x09, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x04, 'c', 'n', '=', 'x', // target Dn string
              0x04, 0x01, ' '} ); // empty issuer Dn

        CertGenerationContainer container = new CertGenerationContainer();
        bb.flip();

        try
        {
            decoder.decode( bb, container );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x30, 0x15, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x04, 'c', 'n', '=', 'x', // target Dn string
              0x04, 0x04, 'c', 'n', '=', 'x', // issuer Dn
              0x04, 0x01, ' ' } ); // empty subject Dn

        CertGenerationContainer container = new CertGenerationContainer();
        bb.flip();

        try
        {
            decoder.decode( bb, container );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

        ByteBuffer bb = ByteBuffer.allocate( 2 );

        bb.put( new byte[]
            { 0x30, 0x00 }); // CertGenerateObject ::= SEQUENCE {

        CertGenerationContainer container = new CertGenerationContainer();
        bb.flip();

        try
        {
            decoder.decode( bb, container );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x04, 0x03, 'R', 'S', 'A' } );

        String decodedPdu = Strings.dumpBytes(bb.array());
        bb.flip();

        CertGenerationContainer container = new CertGenerationContainer();
        try
        {
            decoder.decode( bb, container );
        }
        catch ( DecoderException e )
        {
            fail( e.getMessage() );
        }

        CertGenerationObject certGenObj = container.getCertGenerationObject();
        assertEquals( dn, certGenObj.getTargetDN() );
        assertEquals( dn, certGenObj.getIssuerDN() );
        assertEquals( dn, certGenObj.getSubjectDN() );
        assertEquals( keyAlgo, certGenObj.getKeyAlgorithm() );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x30, 0x03, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x01, ' ' } ); // empty targetDN value

        bb.flip();

        CertGenerationContainer container = new CertGenerationContainer();

        try
        {
            decoder.decode( bb, container );
            fail( "shouldn't accept the empty targetDN" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

        bb.put( new byte[]
            { 0x30, 0x09, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x04, 'c', 'n', '=', 'x', // target Dn string
              0x04, 0x01, ' '} ); // empty issuer Dn

        CertGenerationContainer container = new CertGenerationContainer();
        bb.flip();

        try
        {
            decoder.decode( bb, container );
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationContainer

            { 0x30, 0x15, // CertGenerateObject ::= SEQUENCE {
              0x04, 0x04, 'c', 'n', '=', 'x', // target Dn string
              0x04, 0x04, 'c', 'n', '=', 'x', // issuer Dn
              0x04, 0x01, ' ' } ); // empty subject Dn

        CertGenerationContainer container = new CertGenerationContainer();
        bb.flip();

        try
        {
            decoder.decode( bb, container );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.