Examples of PaEncTsEnc


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

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        PaEncTsEnc paEncTsEnc = paEncTsEncContainer.getPaEncTsEnc();
       
        assertEquals( "20101010234545Z", paEncTsEnc.getPaTimestamp().toString() );
        assertEquals( -1, paEncTsEnc.getPausec() );
       
        ByteBuffer bb = ByteBuffer.allocate( paEncTsEnc.computeLength() );
       
        try
        {
            bb = paEncTsEnc.encode( bb );
   
            // Check the length
            assertEquals( 0x15, bb.limit() );
   
            String encodedPdu = Strings.dumpBytes(bb.array());
View Full Code Here

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

        {
            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, de );
        }

        // get the decoded PaEncTsEnc
        PaEncTsEnc paEncTsEnc = ( ( PaEncTsEncContainer ) paEncTsEncContainer ).getPaEncTsEnc();

        return paEncTsEnc;
    }
View Full Code Here

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

        EncryptedData data = new EncryptedData( EncryptionType.DES_CBC_MD5, 0, DES_ENCRYPTED_TIME_STAMP );

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070322233107Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 291067, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        EncryptedData data = new EncryptedData( EncryptionType.DES3_CBC_SHA1_KD, 0, TRIPLE_DES_ENCRYPTED_TIME_STAMP );

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object =  KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 460450, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        KerberosKey kerberosKey = new KerberosKey( principal, "secret".toCharArray(), algorithm );
        EncryptionKey key = new EncryptionKey( EncryptionType.DES3_CBC_SHA1_KD, kerberosKey.getEncoded() );

        String zuluTime = "20070410190400Z";
        int microSeconds = 460450;
        PaEncTsEnc encryptedTimeStamp = getEncryptedTimeStamp( zuluTime, microSeconds );

        EncryptedData encryptedData = null;

        try
        {
            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", zuluTime, object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", microSeconds, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        EncryptedData data = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, 0, AES128_ENCRYPTED_TIME_STAMP );

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070410212557Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 379386, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        KerberosKey kerberosKey = new KerberosKey( principal, "secret".toCharArray(), "AES128" );
        EncryptionKey key = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, kerberosKey.getEncoded() );

        String zuluTime = "20070410190400Z";
        int microSeconds = 460450;
        PaEncTsEnc encryptedTimeStamp = getEncryptedTimeStamp( zuluTime, microSeconds );

        EncryptedData encryptedData = null;

        try
        {
            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 460450, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        EncryptedData data = new EncryptedData( EncryptionType.AES256_CTS_HMAC_SHA1_96, 0, AES256_ENCRYPTED_TIME_STAMP );

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070410212809Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 298294, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

        EncryptionKey key = new EncryptionKey( EncryptionType.AES256_CTS_HMAC_SHA1_96, kerberosKey.getEncoded() );

        String zuluTime = "20070410190400Z";
        int microSeconds = 460450;
        PaEncTsEnc encryptedTimeStamp = getEncryptedTimeStamp( zuluTime, microSeconds );

        EncryptedData encryptedData = null;

        try
        {
            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }

        try
        {
            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
            PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
            assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString() );
            assertEquals( "MicroSeconds", 460450, object.getPausec() );
        }
        catch ( KerberosException ke )
        {
            fail( "Should not have caught exception." );
        }
View Full Code Here

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

            date = DateUtils.DATE_FORMAT.parse( zuluTime );
        }

        KerberosTime timeStamp = new KerberosTime( date );

        return new PaEncTsEnc( timeStamp, microSeconds );
    }
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.