Examples of PaData


Examples of org.apache.directory.shared.kerberos.components.PaData

    /**
     * {@inheritDoc}
     */
    public void action( PaDataContainer paDataContainer ) throws DecoderException
    {
        PaData paData = new PaData();
        paDataContainer.setPaData( paData );

        if ( IS_DEBUG )
        {
            LOG.debug( "PaData created" );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Store the PData in the container
        PaData paData = paDataContainer.getPaData();
        KdcRep kdcRep = kdcRepContainer.getKdcRep();
        kdcRep.addPaData( paData );

        if ( IS_DEBUG )
        {
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

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

        PaData paData = paDataContainer.getPaData();
        // The PaData's type is an integer
        BerValue value = tlv.getValue();

        try
        {
            int paDataType = IntegerDecoder.parse( value );

            paData.setPaDataType( PaDataType.getTypeByValue( paDataType ) );

            if ( IS_DEBUG )
            {
                LOG.debug( "padata-type : {}", paDataType );
            }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

            de.printStackTrace();

            fail( de.getMessage() );
        }

        PaData checksum = container.getPaData();

        assertEquals( PaDataType.getTypeByValue( 2 ), checksum.getPaDataType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "padata" ), checksum.getPaDataValue() ) );

        ByteBuffer bb = ByteBuffer.allocate( checksum.computeLength() );

        try
        {
            bb = checksum.encode( bb );

            // Check the length
            assertEquals( 0x11, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Store the PData in the container
        PaData paData = paDataContainer.getPaData();
        KdcReq kdcReq = kdcReqContainer.getKdcReq();
        kdcReq.addPaData( paData );

        if ( IS_DEBUG )
        {
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

        ByteBuffer buffer = ByteBuffer.allocate( applicationRequest.computeLength() );
        byte[] encodedApReq = applicationRequest.encode( buffer ).array();

        PaData[] paData = new PaData[1];

        PaData preAuth = new PaData();
        preAuth.setPaDataType( PaDataType.PA_TGS_REQ );
        preAuth.setPaDataValue( encodedApReq );

        paData[0] = preAuth;

        return paData;
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

    private static byte[] preparePreAuthenticationError( List<EncryptionType> clientEncryptionTypes,
        List<EncryptionType> serverEncryptionTypes )
    {
        PaData[] paDataSequence = new PaData[2];

        PaData paData = new PaData();
        paData.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );
        paData.setPaDataValue( Strings.EMPTY_BYTES );

        paDataSequence[0] = paData;

        ETypeInfo eTypeInfo = new ETypeInfo();

        for ( EncryptionType encryptionType : clientEncryptionTypes )
        {
            if ( serverEncryptionTypes.contains( encryptionType ) )
            {
                ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
                eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
            }
        }

        byte[] encTypeInfo = null;

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
            encTypeInfo = eTypeInfo.encode( buffer ).array();
        }
        catch ( EncoderException ioe )
        {
            return null;
        }

        PaData responsePaData = new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo );

        MethodData methodData = new MethodData();
        methodData.addPaData( responsePaData );

        try
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

            KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );

        ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
        byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

        PaData preAuth = new PaData();
        preAuth.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );
        preAuth.setPaDataValue( encodedEncryptedData );

        paData[0] = preAuth;

        return paData;
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

            KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );

        ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
        byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

        PaData preAuth = new PaData();
        preAuth.setPaDataType( PaDataType.PA_PK_AS_REQ );
        preAuth.setPaDataValue( encodedEncryptedData );

        paData[0] = preAuth;

        return paData;
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.PaData

        // Update the parent
        methodDataContainer.updateParent();

        // Store the PA-DATA in the container
        PaData paData = paDataContainer.getPaData();
        methodDataContainer.addPaData( paData );


        if ( IS_DEBUG )
        {
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.