Package org.apache.directory.shared.asn1.der

Examples of org.apache.directory.shared.asn1.der.DERApplicationSpecific


            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04069 ) );
        }

        Value value = tlv.getValue();

        try
        {
            int messageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );

            container.setMessageId( messageId );

            if ( IS_DEBUG )
            {
                LOG.debug( "Ldap Message Id has been decoded : " + messageId );
            }
        }
        catch ( IntegerDecoderException ide )
        {
            LOG.error( I18n.err( I18n.ERR_04070, Strings.dumpBytes( value.getData() ), ide
                .getLocalizedMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( ide.getMessage() );
        }
View Full Code Here


        // a FF, it's a TRUE. Any other value should be an error,
        // but we could relax this constraint. So if we have
        // something
        // which is not 0, it will be interpreted as TRUE, but we
        // will generate a warning.
        Value value = tlv.getValue();

        try
        {
            control.setCritical( BooleanDecoder.parse( value ) );
        }
        catch ( BooleanDecoderException bde )
        {
            LOG.error( I18n
                .err( I18n.ERR_04100, Strings.dumpBytes( value.getData() ), bde.getMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( bde.getMessage() );
        }
View Full Code Here

        // a FF, it's a TRUE. Any other value should be an error,
        // but we could relax this constraint. So if we have
        // something
        // which is not 0, it will be interpreted as TRUE, but we
        // will generate a warning.
        Value value = tlv.getValue();

        try
        {
            modifyDnRequest.setDeleteOldRdn( BooleanDecoder.parse( value ) );
        }
        catch ( BooleanDecoderException bde )
        {
            LOG.error( I18n
                .err( I18n.ERR_04091, Strings.dumpBytes( value.getData() ), bde.getMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( bde.getMessage() );
        }
View Full Code Here

     */
    public static Ticket decode( byte[] encodedTicket ) throws IOException
    {
        ASN1InputStream ais = new ASN1InputStream( encodedTicket );

        DERApplicationSpecific app = ( DERApplicationSpecific ) ais.readObject();

        return decode( app );
    }
View Full Code Here

        Ticket[] tickets = new Ticket[sequence.size()];

        int ii = 0;
        for ( Enumeration<DEREncodable> e = sequence.getObjects(); e.hasMoreElements(); )
        {
            DERApplicationSpecific object = ( DERApplicationSpecific ) e.nextElement();
            tickets[ii] = decode( object );
        }

        return tickets;
    }
View Full Code Here

    public Encodable decode( byte[] encodedTicket ) throws IOException
    {
        ASN1InputStream ais = new ASN1InputStream( encodedTicket );

        DERApplicationSpecific app = ( DERApplicationSpecific ) ais.readObject();

        DERSequence sequence = ( DERSequence ) app.getObject();

        return decodeEncTicketPartSequence( sequence );
    }
View Full Code Here

     */
    public PrivateMessage decode( byte[] encodedPrivateMessage ) throws IOException
    {
        ASN1InputStream ais = new ASN1InputStream( encodedPrivateMessage );

        DERApplicationSpecific app = ( DERApplicationSpecific ) ais.readObject();

        DERSequence privateMessage = ( DERSequence ) app.getObject();

        return decodePrivateMessageSequence( privateMessage );
    }
View Full Code Here

    public Encodable decode( byte[] encoded ) throws IOException
    {
        ASN1InputStream ais = new ASN1InputStream( encoded );

        DERApplicationSpecific app = ( DERApplicationSpecific ) ais.readObject();

        DERSequence sequence = ( DERSequence ) app.getObject();

        return decodeEncKdcRepPartSequence( sequence );
    }
View Full Code Here

    public Encodable decode( byte[] encodedEncApRepPart ) throws IOException
    {
        ASN1InputStream ais = new ASN1InputStream( encodedEncApRepPart );

        DERApplicationSpecific app = ( DERApplicationSpecific ) ais.readObject();

        DERSequence apRepPart = ( DERSequence ) app.getObject();

        return decodeEncApRepPartSequence( apRepPart );
    }
View Full Code Here

        vector.add( new DERTaggedObject( 0, DERInteger.valueOf( ticket.getTktVno() ) ) );
        vector.add( new DERTaggedObject( 1, DERGeneralString.valueOf( ticket.getRealm() ) ) );
        vector.add( new DERTaggedObject( 2, PrincipalNameEncoder.encode( ticket.getSName() ) ) );
        vector.add( new DERTaggedObject( 3, EncryptedDataEncoder.encodeSequence( ticket.getEncPart() ) ) );

        DERApplicationSpecific ticketSequence = null;

        try
        {
            ticketSequence = DERApplicationSpecific.valueOf( 1, vector );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.der.DERApplicationSpecific

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.