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

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


        String passPhrase = "randomKey";
        EncryptionKey serverKey = getEncryptionKey( serverPrincipal, passPhrase );
        Ticket tgt = getTicket( encTicketPart, serverPrincipal, serverKey );

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setSName( new PrincipalName( new KerberosPrincipal( "ldap/ldap.example.com@EXAMPLE.COM" ) ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );

        List<EncryptionType> encryptionTypes = new ArrayList<EncryptionType>();
        encryptionTypes.add( EncryptionType.DES_CBC_MD5 );
View Full Code Here


    @Test
    public void testStartTimeAbsentNoPostdate() throws Exception
    {
        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( new PrincipalName( new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" ) ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        kdcReqBody.setKdcOptions( new KdcOptions() );
View Full Code Here

    {
        KerberosPrincipal servicePrincipalName = new KerberosPrincipal( "ldap/ldap.example.com@EXAMPLE.COM" );

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( new PrincipalName( servicePrincipalName ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        kdcReqBody.setKdcOptions( new KdcOptions() );
View Full Code Here

        KerberosTime now = new KerberosTime();

        krbError.setErrorCode( ErrorType.getTypeByValue( exception.getErrorCode() ) );
        krbError.setEText( exception.getLocalizedMessage() );
        krbError.setSName( new PrincipalName( principal ) );
        krbError.setRealm( principal.getRealm() );
        krbError.setSTime( now );
        krbError.setSusec( 0 );
        krbError.setEData( exception.getExplanatoryData() );
View Full Code Here

        catch ( DecoderException de )
        {
            throw de;
        }

        PrincipalName principalName = principalNameContainer.getPrincipalName();

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

        KerberosTime now = new KerberosTime();

        krbError.setErrorCode( ErrorType.getTypeByValue( exception.getErrorCode() ) );
        krbError.setEText( exception.getLocalizedMessage() );
        krbError.setSName( new PrincipalName( principal ) );
        krbError.setRealm( principal.getRealm() );
        krbError.setSTime( now );
        krbError.setSusec( 0 );
        krbError.setEData( exception.getExplanatoryData() );
View Full Code Here

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

        // get the decoded PrincipalName
        PrincipalName principalName = ( ( PrincipalNameContainer ) principalNameContainer ).getPrincipalName();

        return principalName;
    }
View Full Code Here

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
        }

        // Get the principalName
        PrincipalName principalName = principalNameContainer.getPrincipalName();

        Value value = tlv.getValue();

        // The PrincipalName must be pure ASCII witout any control character
        if ( KerberosUtils.isKerberosString( value.getData() ) )
        {
            String nameString = Strings.utf8ToString(value.getData());

            principalName.addName( nameString );
            principalNameContainer.setGrammarEndAllowed( true );

            if ( IS_DEBUG )
            {
                LOG.debug( "PrincipalName String : {}", nameString );
View Full Code Here

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
        }

        // We have to create a PrincipalName object here
        PrincipalName principalName = new PrincipalName();
        principalNameContainer.setPrincipalName( principalName );

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

     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, PrincipalNameContainer principalNameContainer )
    {
        PrincipalName principalName = principalNameContainer.getPrincipalName();

        PrincipalNameType principalNameType = PrincipalNameType.getTypeByValue( value );
        principalName.setNameType( principalNameType );

        if ( IS_DEBUG )
        {
            LOG.debug( "name-type : {}" + principalNameType );
        }
View Full Code Here

TOP

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

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.