jdk/src/share/classes/sun/security/krb5/PrincipalName.java
changeset 3949 00603a93b589
parent 2918 395b9ffa7cc6
child 5455 19d2395cfe3e
equal deleted inserted replaced
3948:736156ecc24c 3949:00603a93b589
    36 import java.net.*;
    36 import java.net.*;
    37 import java.util.Vector;
    37 import java.util.Vector;
    38 import java.io.IOException;
    38 import java.io.IOException;
    39 import java.math.BigInteger;
    39 import java.math.BigInteger;
    40 import sun.security.krb5.internal.ccache.CCacheOutputStream;
    40 import sun.security.krb5.internal.ccache.CCacheOutputStream;
       
    41 import sun.security.krb5.internal.util.KerberosString;
    41 
    42 
    42 
    43 
    43 /**
    44 /**
    44  * This class encapsulates a Kerberos principal.
    45  * This class encapsulates a Kerberos principal.
    45  */
    46  */
   244             }
   245             }
   245             Vector<String> v = new Vector<String> ();
   246             Vector<String> v = new Vector<String> ();
   246             DerValue subSubDer;
   247             DerValue subSubDer;
   247             while(subDer.getData().available() > 0) {
   248             while(subDer.getData().available() > 0) {
   248                 subSubDer = subDer.getData().getDerValue();
   249                 subSubDer = subDer.getData().getDerValue();
   249                 v.addElement(subSubDer.getGeneralString());
   250                 v.addElement(new KerberosString(subSubDer).toString());
   250             }
   251             }
   251             if (v.size() > 0) {
   252             if (v.size() > 0) {
   252                 nameStrings = new String[v.size()];
   253                 nameStrings = new String[v.size()];
   253                 v.copyInto(nameStrings);
   254                 v.copyInto(nameStrings);
   254             } else {
   255             } else {
   552         temp.putInteger(bint);
   553         temp.putInteger(bint);
   553         bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), temp);
   554         bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), temp);
   554         temp = new DerOutputStream();
   555         temp = new DerOutputStream();
   555         DerValue der[] = new DerValue[nameStrings.length];
   556         DerValue der[] = new DerValue[nameStrings.length];
   556         for (int i = 0; i < nameStrings.length; i++) {
   557         for (int i = 0; i < nameStrings.length; i++) {
   557             der[i] = new DerValue(DerValue.tag_GeneralString, nameStrings[i]);
   558             der[i] = new KerberosString(nameStrings[i]).toDerValue();
   558         }
   559         }
   559         temp.putSequence(der);
   560         temp.putSequence(der);
   560         bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), temp);
   561         bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), temp);
   561         temp = new DerOutputStream();
   562         temp = new DerOutputStream();
   562         temp.write(DerValue.tag_Sequence, bytes);
   563         temp.write(DerValue.tag_Sequence, bytes);