Examples of PrincipalName


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

            sb.append( "\n\t" + "checksumType           " + checksumType );
            sb.append( "\n\t" + "clientAddress          " + clientAddress );
            sb.append( "\n\t" + "clientAddresses        " + clientAddresses );
            sb.append( "\n\t" + "caddr contains sender  " + caddrContainsSender );

            PrincipalName requestServerPrincipal = tgsContext.getRequest().getKdcReqBody().getSName();
            PrincipalStoreEntry requestPrincipal = tgsContext.getRequestPrincipalEntry();

            sb.append( "\n\t" + "principal              " + requestServerPrincipal );
            sb.append( "\n\t" + "cn                     " + requestPrincipal.getCommonName() );
            sb.append( "\n\t" + "realm                  " + requestPrincipal.getRealmName() );
            sb.append( "\n\t" + "principal              " + requestPrincipal.getPrincipal() );
            sb.append( "\n\t" + "SAM type               " + requestPrincipal.getSamType() );

            PrincipalName ticketServerPrincipal = tgsContext.getTgt().getSName();
            PrincipalStoreEntry ticketPrincipal = tgsContext.getTicketPrincipalEntry();

            sb.append( "\n\t" + "principal              " + ticketServerPrincipal );
            sb.append( "\n\t" + "cn                     " + ticketPrincipal.getCommonName() );
            sb.append( "\n\t" + "realm                  " + ticketPrincipal.getRealmName() );
View Full Code Here

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

        catch ( DecoderException de )
        {
            throw de;
        }

        PrincipalName principalName = principalNameContainer.getPrincipalName();

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

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

public class PrincipalNameTest
{
    @Test
    public void testEncodingPrincipalNameOneName() throws Exception
    {
        PrincipalName principal = new PrincipalName( "Test", PrincipalNameType.KRB_NT_PRINCIPAL );

        ByteBuffer encoded = ByteBuffer.allocate( principal.computeLength() );

        principal.encode( encoded );

        byte[] expectedResult = new byte[]
            {
                0x30, 0x0F,
                ( byte ) 0xA0, 0x03,
View Full Code Here

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


    @Test
    public void testEncodingPrincipalName3names() throws Exception
    {
        PrincipalName principal = new PrincipalName( "Test1", PrincipalNameType.KRB_NT_PRINCIPAL );
        principal.addName( "Test2" );
        principal.addName( "Test3" );

        ByteBuffer encoded = ByteBuffer.allocate( principal.computeLength() );

        principal.encode( encoded );

        byte[] expectedResult = new byte[]
            {
                0x30, 0x1e,
                ( byte ) 0xA0, 0x03,
View Full Code Here

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


    @Test
    public void testEncodingPrincipalNameNullName() throws Exception
    {
        PrincipalName principal = new PrincipalName( null, PrincipalNameType.KRB_NT_PRINCIPAL );

        ByteBuffer encoded = ByteBuffer.allocate( principal.computeLength() );

        principal.encode( encoded );

        byte[] expectedResult = new byte[]
            {
                0x30, 0x09,
                ( byte ) 0xA0, 0x03,
View Full Code Here

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

    @Test
    public void testDecodeKrebCred() throws Exception
    {
        EncryptedData encPart = new EncryptedData( EncryptionType.DES3_CBC_MD5, 0, new byte[]
            { 0, 1 } );
        PrincipalName pName = new PrincipalName( "pname", PrincipalNameType.KRB_NT_PRINCIPAL );

        String realm = "ticketRealm";
        Ticket t1 = new Ticket( pName, encPart );
        t1.setRealm( realm );
View Full Code Here

Examples of org.apache.harmony.auth.internal.kerberos.v5.PrincipalName

        if (pos != -1) {
            port = Integer.parseInt(kdc.substring(pos + 1));
            kdc = kdc.substring(0, pos);
        }

        PrincipalName cname = new PrincipalName(PrincipalName.NT_UNKNOWN, new String[] { name });

        PrincipalName krbtgt = new PrincipalName(PrincipalName.NT_SRV_XHST, new String[] {
                "krbtgt", realm }); //$NON-NLS-1$

        try {
            Ticket ticket = KrbClient.doAS(InetAddress.getByName(kdc), port, cname, realm,
                    krbtgt);
View Full Code Here

Examples of org.apache.harmony.auth.internal.kerberos.v5.PrincipalName

    private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {

        s.defaultReadObject();

        PrincipalName principalName = (PrincipalName) PrincipalName.ASN1.decode((byte[]) s
                .readObject());
        realm = (String) ASN1StringType.GENERALSTRING.decode((byte[]) s.readObject());

        String[] nameString = principalName.getName();
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < (nameString.length - 1); i++) {
            buf.append(nameString[i]);
            buf.append('/');
        }
        // append last name element
        buf.append(nameString[nameString.length - 1]);

        // append realm
        buf.append('@');
        buf.append(realm);

        name = buf.toString();

        type = principalName.getType();

        //FIXME: verify serialized values
    }
View Full Code Here

Examples of org.apache.harmony.auth.internal.kerberos.v5.PrincipalName

            for (int i = 0; i < nameString.length; i++) {
                nameString[i] = strTknzr.nextToken();
            }
        }

        byte[] enc = PrincipalName.ASN1.encode(new PrincipalName(type, nameString));
        s.writeObject(enc);

        enc = ASN1StringType.GENERALSTRING.encode(realm);
        s.writeObject(enc);
    }
View Full Code Here

Examples of sun.security.krb5.PrincipalName

    String serviceName = "host/" + remoteHost.getHost();
    if (LOG.isDebugEnabled())
      LOG.debug("Fetching service ticket for host at: " + serviceName);
    Credentials serviceCred = null;
    try {
      PrincipalName principal = new PrincipalName(serviceName,
          PrincipalName.KRB_NT_SRV_HST);
      serviceCred = Credentials.acquireServiceCreds(principal
          .toString(), Krb5Util.ticketToCreds(getTgtFromSubject()));
    } catch (Exception e) {
      throw new IOException("Can't get service ticket for: "
          + serviceName, e);
    }
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.