Package org.apache.directory.shared.kerberos.components

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


        EncTgsRepPart encTgsRepPart = new EncTgsRepPart();
        encTgsRepPart.setEncKdcRepPart( encKdcRepPart );

        Authenticator authenticator = tgsContext.getAuthenticator();

        EncryptedData encryptedData;

        if ( authenticator.getSubKey() != null )
        {
            encryptedData = cipherTextHandler.seal( authenticator.getSubKey(), encTgsRepPart,
                KeyUsage.TGS_REP_ENC_PART_TGS_AUTHNT_SUB_KEY );
View Full Code Here


        PaEncTsEnc encryptedTimeStamp = new PaEncTsEnc( timeStamp, 0 );

        EncryptionKey clientKey = getEncryptionKey( clientPrincipal, passPhrase, config.getEncryptionTypes() );

        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 );
View Full Code Here

    {
        PaData[] paData = new PaData[1];

        PaEncTsEnc encryptedTimeStamp = new PaEncTsEnc( timeStamp, 0 );

        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 );
View Full Code Here

             */
            throw new KerberosException( ErrorType.KDC_ERR_BADOPTION );
        }
        else
        {
            EncryptedData encryptedData = cipherTextHandler.seal( serverKey, newTicketPart,
                KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY );

            Ticket newTicket = new Ticket( request.getKdcReqBody().getSName(), encryptedData );
            newTicket.setEncTicketPart( newTicketPart );
            newTicket.setRealm( request.getKdcReqBody().getRealm() );
View Full Code Here

        EncTgsRepPart encTgsRepPart = new EncTgsRepPart();
        encTgsRepPart.setEncKdcRepPart( encKdcRepPart );

        Authenticator authenticator = tgsContext.getAuthenticator();

        EncryptedData encryptedData;

        if ( authenticator.getSubKey() != null )
        {
            encryptedData = cipherTextHandler.seal( authenticator.getSubKey(), encTgsRepPart,
                KeyUsage.TGS_REP_ENC_PART_TGS_AUTHNT_SUB_KEY );
View Full Code Here

        catch ( DecoderException de )
        {
            throw de;
        }

        EncryptedData encryptedData = encryptedDataContainer.getEncryptedData();

        if ( IS_DEBUG )
        {
            LOG.debug( "EncryptedData : " + encryptedData );
        }
View Full Code Here

    @Override
    protected void setIntegerValue( int value, EncryptedDataContainer encryptedDataContainer )
    {
        EncryptionType encryptionType = EncryptionType.getTypeByValue( value );

        EncryptedData encryptedData = encryptedDataContainer.getEncryptedData();
        encryptedData.setEType( encryptionType );

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

     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, EncryptedDataContainer encryptedDataContainer )
    {
        EncryptedData encryptedData = encryptedDataContainer.getEncryptedData();
        encryptedData.setKvno( value );
    }
View Full Code Here

            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
        }

        if ( encryptedDataContainer.getEncryptedData() == null )
        {
            EncryptedData encryptedData = new EncryptedData();
            encryptedDataContainer.setEncryptedData( encryptedData );

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded EncryptedData
        EncryptedData encryptedData = ( ( EncryptedDataContainer ) encryptedDataContainer ).getEncryptedData();

        assertEquals( EncryptionType.AES256_CTS_HMAC_SHA1_96, encryptedData.getEType() );
        assertEquals( 5, encryptedData.getKvno() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8("abcdef"), encryptedData.getCipher() ) );

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( encryptedData.computeLength() );
       
        try
        {
            bb = encryptedData.encode( bb );
   
            // Check the length
            assertEquals( 0x16, bb.limit() );
   
            String encodedPdu = Strings.dumpBytes(bb.array());
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.kerberos.components.EncryptedData

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.