Examples of computeLength()


Examples of org.apache.directory.shared.kerberos.components.EncKrbCredPart.computeLength()

            presentFieldList.add( fieldValHolder );

            Field f = encKrbCredPartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
            f.set( expected, fieldValHolder.value );

            ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
            expected.encode( stream );
            stream.flip();

            Asn1Decoder decoder = new Asn1Decoder();
            EncKrbCredPartContainer container = new EncKrbCredPartContainer( stream );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.EncKrbPrivPart.computeLength()

        assertEquals( 1, encKrbPrivPart.getUsec() );
        assertEquals( 1, encKrbPrivPart.getSeqNumber() );
        assertEquals( ad, encKrbPrivPart.getSenderAddress() );
        assertEquals( ad, encKrbPrivPart.getRecipientAddress() );

        int computedLen = encKrbPrivPart.computeLength();

        assertEquals( streamLen, computedLen );

        try
        {
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.EncryptedData.computeLength()

        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

Examples of org.apache.directory.shared.kerberos.components.EncryptionKey.computeLength()

        EncryptionKey encKey = container.getEncryptionKey();

        assertEquals( EncryptionType.getTypeByValue( 2 ), encKey.getKeyType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "keyval" ), encKey.getKeyValue() ) );

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

        try
        {
            bb = encKey.encode( bb );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.HostAddress.computeLength()

        assertEquals( HostAddrType.ADDRTYPE_INET, hostAddress.getAddrType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "192.168.0.1" ), hostAddress.getAddress() ) );

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( hostAddress.computeLength() );

        try
        {
            bb = hostAddress.encode( bb );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.HostAddresses.computeLength()

            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i] ), hostAddress.getAddress() ) );
            i++;
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( hostAddresses.computeLength() );

        try
        {
            bb = hostAddresses.encode( bb );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.KdcRep.computeLength()

        }

        KdcRep kdcRep = kdcRepContainer.getKdcRep();

        // Check the encoding
        int length = kdcRep.computeLength();

        // Check the length, should be 3 bytes longer as the kdcRep is a AS-REP
        assertEquals( 0xAC, length );

        // Check the encoding
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.KdcReq.computeLength()

        }

        KdcReq kdcReq = kdcReqContainer.getKdcReq();

        // Check the encoding
        int length = kdcReq.computeLength();

        // Check the length
        assertEquals( 0x193, length );

        // Check the encoding
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.KdcReqBody.computeLength()

        ticket2.setEncPart( new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, "abcdef".getBytes() ) );

        body.addAdditionalTicket( ticket2 );

        // Check the encoding
        int length = body.computeLength();

        // Check the length
        assertEquals( 0x15B, length );

        // Check the encoding
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.KrbCredInfo.computeLength()

                presentFieldList.add( fieldValHolder );
                f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
                f.set( expected, fieldValHolder.value );
            }

            ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
            expected.encode( stream );
            stream.flip();

            Asn1Decoder decoder = new Asn1Decoder();
            KrbCredInfoContainer container = new KrbCredInfoContainer();
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.