Examples of PaData


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

        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, 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

                password, ciphers );

            /** The client's encryption key. */
            key = keys.get( ciphers.iterator().next() ); // FIXME this is always taking first cipher, not good

            PaData paData = new PaData();

            if ( clientOptions.isUsePaEncTimestamp() )
            {

                PaEncTsEnc paEncTimeStamp = new PaEncTsEnc( new KerberosTime(), 0 );

                EncryptedData encryptedData = null;

                try
                {
                    encryptedData = lockBox.seal( key, paEncTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
                }
                catch ( KerberosException ke )
                {
                    LOG.error( "Unexpected exception encrypting timestamp.", ke );
                }

                ByteBuffer buf = ByteBuffer.allocate( encryptedData.computeLength() );
                byte[] encodedEncryptedData = encryptedData.encode( buf ).array();
                paData.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );

                paData.setPaDataValue( encodedEncryptedData );
            }

            AsReq request = new AsReq();
            request.setKdcReqBody( reqBody );
            request.addPaData( paData );
View Full Code Here

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

        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, 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

            return null;
        }

        MethodData methodData = new MethodData();

        methodData.addPaData( new PaData( PaDataType.PA_ENC_TIMESTAMP, null ) );

        if ( !isNewEtype )
        {
            methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo ) );
        }

        methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO2, encTypeInfo2 ) );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
View Full Code Here

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

            PaEncTsEnc tmstmp = new PaEncTsEnc();
            tmstmp.setPaTimestamp( new KerberosTime() );
           
            EncryptedData paDataValue = cipherTextHandler.encrypt( clientKey, getEncoded( tmstmp ), KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
           
            PaData paEncTstmp = new PaData();
            paEncTstmp.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );
            paEncTstmp.setPaDataValue( getEncoded( paDataValue ) );
           
            req.addPaData( paEncTstmp );
        }
       
        // Get the result from the future
View Full Code Here

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

        tgsReqBody.setSName( principalName );
       
        TgsReq tgsReq = new TgsReq();
        tgsReq.setKdcReqBody( tgsReqBody );
       
        PaData authnHeader = new PaData();
        authnHeader.setPaDataType( PaDataType.PA_TGS_REQ );
        authnHeader.setPaDataValue( getEncoded( apReq ) );
       
        tgsReq.addPaData( authnHeader );
       
        // Get the result from the future
        try
View Full Code Here

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

public class PaDataTest
{
    @Test
    public void testEncodingPreAuthenticationData() throws Exception
    {
        PaData pad = new PaData( PaDataType.PA_ASF3_SALT, new byte[]
            { 0x01, 0x02, 0x03 } );

        ByteBuffer encoded = ByteBuffer.allocate( pad.computeLength() );

        pad.encode( encoded );

        byte[] expectedResult = new byte[]
            {
                0x30, 0x0c,
                ( byte ) 0xA1, 0x03,
View Full Code Here

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


    @Test
    public void testEncodingNullPreAuthenticationData() throws Exception
    {
        PaData pad = new PaData( PaDataType.PA_ASF3_SALT, null );

        ByteBuffer encoded = ByteBuffer.allocate( pad.computeLength() );

        pad.encode( encoded );

        byte[] expectedResult = new byte[]
            {
                0x30, 0x09,
                ( byte ) 0xA1, 0x03,
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 )
        {
            LOG.debug( "PA-DATA added : {}", paData );
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.