Package org.apache.directory.server.kerberos.shared.messages.value

Examples of org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey


        // Make changes to test.

        // Seal the ticket for the server.
        KerberosPrincipal serverPrincipal = new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
        String passPhrase = "randomKey";
        EncryptionKey serverKey = getEncryptionKey( serverPrincipal, passPhrase );
        Ticket tgt = getTicket( encTicketPartModifier, serverPrincipal, serverKey );

        RequestBodyModifier modifier = new RequestBodyModifier();
        modifier.setServerName( getPrincipalName( "ldap/ldap.example.com@EXAMPLE.COM" ) );
        modifier.setRealm( "EXAMPLE.COM" );
View Full Code Here


        Subject subject = new Subject();

        for ( EncryptionType encryptionType : entry.getKeyMap().keySet() )
        {
            EncryptionKey key = entry.getKeyMap().get( encryptionType );

            byte[] keyBytes = key.getKeyValue();
            int type = key.getKeyType().getOrdinal();
            int kvno = key.getKeyVersion();

            KerberosKey serviceKey = new KerberosKey( servicePrincipal, keyBytes, type, kvno );

            subject.getPrivateCredentials().add( serviceKey );
        }
View Full Code Here

        KerberosPrincipal serverPrincipal = new KerberosPrincipal( "kadmin/changepw@EXAMPLE.COM" );
        String serverPassword = "secret";

        TicketFactory ticketFactory = new TicketFactory();
        EncryptionKey serverKey = ticketFactory.getServerKey( serverPrincipal, serverPassword );
        Ticket serviceTicket = ticketFactory.getTicket( clientPrincipal, serverPrincipal, serverKey );

        EncryptionKey subSessionKey = RandomKeyFactory.getRandomKey( EncryptionType.DES_CBC_MD5 );

        ApOptions apOptions = new ApOptions();

        AuthenticatorModifier modifier = new AuthenticatorModifier();
        modifier.setVersionNumber( 5 );
View Full Code Here

        KerberosPrincipal serverPrincipal = new KerberosPrincipal( "kadmin/changepw@EXAMPLE.COM" );
        String serverPassword = "secret";

        TicketFactory ticketFactory = new TicketFactory();
        EncryptionKey serverKey = ticketFactory.getServerKey( serverPrincipal, serverPassword );
        Ticket serviceTicket = ticketFactory.getTicket( clientPrincipal, serverPrincipal, serverKey );

        EncryptionKey subSessionKey = RandomKeyFactory.getRandomKey( EncryptionType.DES_CBC_MD5 );

        ApOptions apOptions = new ApOptions();

        AuthenticatorModifier modifier = new AuthenticatorModifier();
        modifier.setVersionNumber( 5 );
View Full Code Here


    public boolean checkKeyIntegrity( byte[] encryptedData, KerberosKey kerberosKey )
    {
        EncryptionType keyType = EncryptionType.getTypeByOrdinal( kerberosKey.getKeyType() );
        EncryptionKey key = new EncryptionKey( keyType, kerberosKey.getEncoded() );

        try
        {
            /*
             * Since the pre-auth value is of type PA-ENC-TIMESTAMP, it should be a valid
View Full Code Here

        if ( authHeader.getTicket().getTktVno() != KerberosConstants.KERBEROS_V5 )
        {
            throw new KerberosException( ErrorType.KRB_AP_ERR_BADVERSION );
        }

        EncryptionKey ticketKey = null;

        if ( authHeader.getOption( ApOptions.USE_SESSION_KEY ) )
        {
            ticketKey = authHeader.getTicket().getEncTicketPart().getSessionKey();
        }
View Full Code Here

            {
                throw new IllegalStateException( I18n.err( I18n.ERR_626 ) );
            }

            byte[] encryptionKeyBytes = val.getBytes();
            EncryptionKey encryptionKey = EncryptionKeyDecoder.decode( encryptionKeyBytes );
            map.put( encryptionKey.getKeyType(), encryptionKey );
        }

        return map;
    }
View Full Code Here

        long time = buffer.getUnsignedInt();
        KerberosTime timeStamp = new KerberosTime( time * 1000 );

        byte keyVersion = buffer.get();

        EncryptionKey key = getKeyBlock( buffer, keyVersion );

        return new KeytabEntry( principalName, principalType, timeStamp, keyVersion, key );
    }
View Full Code Here

    {
        int type = buffer.getUnsignedShort();
        byte[] keyblock = getCountedBytes( buffer );

        EncryptionType encryptionType = EncryptionType.getTypeByOrdinal( type );
        EncryptionKey key = new EncryptionKey( encryptionType, keyblock );

        return key;
    }
View Full Code Here

            String algorithm = DEFAULT_CIPHERS.get( encryptionType );

            try
            {
                KerberosKey kerberosKey = new KerberosKey( principal, passPhrase.toCharArray(), algorithm );
                EncryptionKey encryptionKey = new EncryptionKey( encryptionType, kerberosKey.getEncoded(), kerberosKey
                    .getVersionNumber() );

                kerberosKeys.put( encryptionType, encryptionKey );
            }
            catch ( IllegalArgumentException iae )
View Full Code Here

TOP

Related Classes of org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey

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.