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

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


     * @throws IOException
     */
    public byte[] encode( PrivateMessage message ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence privateMessageSequence = encodePrivateMessageSequence( message );
        aos
            .writeObject( DERApplicationSpecific
                .valueOf( message.getMessageType().getOrdinal(), privateMessageSequence ) );
        aos.close();

        return baos.toByteArray();
    }
View Full Code Here



    public byte[] encode( Encodable apRepPart ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence privPartSequence = encodeApRepPartSequence( ( EncApRepPart ) apRepPart );
        aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, privPartSequence ) );
        aos.close();

        return baos.toByteArray();
    }
View Full Code Here


    public byte[] encode( Encodable app ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence initialSequence = encodeInitialSequence( ( KdcReply ) app );
        aos.writeObject( DERApplicationSpecific.valueOf( applicationCode, initialSequence ) );

        return baos.toByteArray();
    }
View Full Code Here

     * @throws IOException
     */
    public byte[] encode( ApplicationReply reply ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence replySequence = encodeReplySequence( reply );
        aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, replySequence ) );
        aos.close();

        return baos.toByteArray();
    }
View Full Code Here

     * @param out
     * @throws IOException
     */
    public void encode( ErrorMessage message, ByteBuffer out ) throws IOException
    {
        ASN1OutputStream aos = new ASN1OutputStream( out );

        DERSequence errorReply = encodeErrorMessageSequence( message );
        aos.writeObject( DERApplicationSpecific.valueOf( message.getMessageType().getOrdinal(), errorReply ) );

        aos.close();
    }
View Full Code Here

     * @throws IOException
     */
    public byte[] encode( ErrorMessage message ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence errorReply = encodeErrorMessageSequence( message );
        aos.writeObject( DERApplicationSpecific.valueOf( message.getMessageType().getOrdinal(), errorReply ) );

        aos.close();

        return baos.toByteArray();
    }
View Full Code Here


    public byte[] encode( Encodable privPart ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence privPartSequence = encodePrivatePartSequence( ( EncKrbPrivPart ) privPart );
        aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, privPartSequence ) );
        aos.close();

        return baos.toByteArray();
    }
View Full Code Here

     * @throws IOException
     */
    public static byte[] encode( EncryptionTypeInfoEntry[] entries ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );
        aos.writeObject( encodeSequence( entries ) );
        aos.close();

        return baos.toByteArray();
    }
View Full Code Here

     * @throws IOException
     */
    public byte[] encode( ChangePasswordData data ) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ASN1OutputStream aos = new ASN1OutputStream( baos );

        DERSequence dataSequence = encodeDataSequence( data );
        aos.writeObject( dataSequence );

        aos.close();

        return baos.toByteArray();
    }
View Full Code Here

     * @param out
     * @throws IOException
     */
    public void encode( ChangePasswordData data, ByteBuffer out ) throws IOException
    {
        ASN1OutputStream aos = new ASN1OutputStream( out );

        DERSequence sequence = encodeDataSequence( data );
        aos.writeObject( sequence );

        aos.close();
    }
View Full Code Here

TOP

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

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.