com.ibm.security.krb5
Class PrincipalName
- java.lang.Object
com.ibm.security.krb5.PrincipalName
All implemented interfaces:
java.lang.Cloneable
Direct known subclasses:
- public class PrincipalName
- extends java.lang.Object
- implements java.lang.Cloneable
Field Summary
Modifier and Type | Field and Description |
---|---|
|
KRB_NT_PRINCIPAL
Just the name of the principal as in DCE, or for users
|
|
KRB_NT_SRV_HST
Service with host name as instance (telnet, rcommands)
|
|
KRB_NT_SRV_INST
Service and other unique instance (krbtgt)
|
|
KRB_NT_SRV_XHST
Service with host as remaining components
|
|
KRB_NT_UID
Unique ID
|
|
KRB_NT_UNKNOWN
Name type not known
|
|
NAME_COMPONENT_SEPARATOR
|
|
NAME_COMPONENT_SEPARATOR_STR
|
|
NAME_REALM_SEPARATOR
|
|
NAME_REALM_SEPARATOR_STR
|
|
REALM_COMPONENT_SEPARATOR
|
|
REALM_COMPONENT_SEPARATOR_STR
|
|
TGS_DEFAULT_NT
|
|
TGS_DEFAULT_SRV_NAME
TGS Name
|
Constructor Summary
Modifier | Constructor and Description |
---|---|
|
PrincipalName()
|
|
PrincipalName(com.ibm.security.util.DerValue encoding)
Returns the ASN.1 encodigng of the
|
|
PrincipalName(java.lang.String name)
|
|
PrincipalName(java.lang.String[] nameParts)
|
|
PrincipalName(java.lang.String[] nameParts,int type)
|
|
PrincipalName(java.lang.String name,int type)
|
|
PrincipalName(java.lang.String name,java.lang.String realm)
|
|
PrincipalName(java.lang.String primary,java.lang.String instance,java.lang.String realm,int type)
Creates a KRB_NT_SRV_INST name from the supplied
name components and realm.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
asn1Encode()
Encodes a
PrincipalName object.
|
|
clone()
|
|
equals(java.lang.Object o)
|
|
equals(PrincipalName other)
|
|
getInstanceComponent()
Returns the instance component of a name.
|
|
getName()
|
|
getNameString()
|
|
getNameStrings()
|
|
getNameType()
|
|
getPrincipalNameAsString()
|
getRealm()
|
|
|
getRealmAsString()
|
|
getRealmString()
|
|
getSalt()
|
|
hashCode()
|
|
isTGS()
Determines whether this is a ticket-granting service
based on the name.
|
|
match(PrincipalName pname)
Checks if two
PrincipalName objects have identical values in their corresponding data fields.
|
|
parse(com.ibm.security.util.DerInputStream data,byte explicitTag,boolean optional)
Parse (unmarshal) a
PrincipalName from a DER
input stream.
|
|
parseName(java.lang.String name)
|
|
setRealm(Realm new_nameRealm)
|
|
setRealm(java.lang.String realmsString)
|
|
setSalt(java.lang.String salt)
|
|
toByteArray()
|
|
toString()
|
|
unparseName(java.lang.String[] nameStrings)
|
|
writePrincipal(CCacheOutputStream cos)
Writes data field values of
PrincipalName in FCC format to an output stream.
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail
KRB_NT_UNKNOWN
- public static final int KRB_NT_UNKNOWN
Name type not known
See Also:
KRB_NT_PRINCIPAL
- public static final int KRB_NT_PRINCIPAL
Just the name of the principal as in DCE, or for users
See Also:
KRB_NT_SRV_INST
- public static final int KRB_NT_SRV_INST
Service and other unique instance (krbtgt)
See Also:
KRB_NT_SRV_HST
- public static final int KRB_NT_SRV_HST
Service with host name as instance (telnet, rcommands)
See Also:
KRB_NT_SRV_XHST
- public static final int KRB_NT_SRV_XHST
Service with host as remaining components
See Also:
KRB_NT_UID
- public static final int KRB_NT_UID
Unique ID
See Also:
TGS_DEFAULT_SRV_NAME
- public static final java.lang.String TGS_DEFAULT_SRV_NAME
TGS Name
See Also:
TGS_DEFAULT_NT
- public static final int TGS_DEFAULT_NT
See Also:
NAME_COMPONENT_SEPARATOR
- public static final char NAME_COMPONENT_SEPARATOR
See Also:
NAME_REALM_SEPARATOR
- public static final char NAME_REALM_SEPARATOR
See Also:
REALM_COMPONENT_SEPARATOR
- public static final char REALM_COMPONENT_SEPARATOR
See Also:
NAME_COMPONENT_SEPARATOR_STR
- public static final java.lang.String NAME_COMPONENT_SEPARATOR_STR
See Also:
NAME_REALM_SEPARATOR_STR
- public static final java.lang.String NAME_REALM_SEPARATOR_STR
See Also:
REALM_COMPONENT_SEPARATOR_STR
- public static final java.lang.String REALM_COMPONENT_SEPARATOR_STR
See Also:
Constructor Detail
PrincipalName
- protected PrincipalName()
PrincipalName
- public PrincipalName(java.lang.String[] nameParts,
- int type)
PrincipalName
- public PrincipalName(java.lang.String[] nameParts)
PrincipalName
- public PrincipalName(com.ibm.security.util.DerValue encoding)
- throws Asn1Exception
- java.io.IOException
Returns the ASN.1 encodigng of the
PrincipalName ::= SEQUENCE {
name-type[0] INTEGER,
name-string[1] SEQUENCE OF GeneralString
}
This definition reflects the Network Working Group RFC 1510 specifications dated September 1993 and available at http://www.ietf.org/rfc/rfc1510.txt.
Parameters:
encoding
- a Der-encoded data. Throws:
Asn1Exception
- if an error occurs while decoding
an ASN1 encoded data. java.io.IOException
- if an I/O error occurs while
reading encoded data. PrincipalName
- public PrincipalName(java.lang.String name,
- int type)
- throws RealmException
Throws:
PrincipalName
- public PrincipalName(java.lang.String name)
- throws RealmException
Throws:
PrincipalName
- public PrincipalName(java.lang.String name,
- java.lang.String realm)
- throws RealmException
Throws:
PrincipalName
- protected PrincipalName(java.lang.String primary,
- java.lang.String instance,
- java.lang.String realm,
- int type)
- throws KrbException
Creates a KRB_NT_SRV_INST name from the supplied
name components and realm.
Parameters:
primary
- the primary component of the name instance
- the instance component of the name realm
- the realm Throws:
Method Detail
clone
- public java.lang.Object clone()
Overrides:
clone
in class java.lang.Object
equals
- public boolean equals(java.lang.Object o)
Overrides:
equals
in class java.lang.Object
equals
- public boolean equals(PrincipalName other)
parse
- public static PrincipalName parse( com.ibm.security.util.DerInputStream data,
- byte explicitTag,
- boolean optional)
- throws Asn1Exception
- java.io.IOException
Parse (unmarshal) a
PrincipalName
from a DER
input stream. This form
parsing might be used when expanding a value which is part of
a constructed sequence and uses explicitly tagged type.
Parameters:
data
- the Der input stream value, which contains one or
more marshaled value. explicitTag
- tag number. optional
- indicate if this data field is optional Returns:
an instance of
PrincipalName
. Throws:
Asn1Exception
- on error. java.io.IOException
parseName
- protected static java.lang.String[] parseName( java.lang.String name)
unparseName
- protected static java.lang.String unparseName( java.lang.String[] nameStrings)
getRealmAsString
- public java.lang.String getRealmAsString( )
getPrincipalNameAsString
- public java.lang.String getPrincipalNameAsString( )
hashCode
- public int hashCode()
Overrides:
hashCode
in class java.lang.Object
getName
- public java.lang.String getName( )
getNameType
- public int getNameType()
getNameStrings
- public java.lang.String[] getNameStrings( )
toByteArray
- public byte[][] toByteArray()
getRealmString
- public java.lang.String getRealmString( )
getRealm
- public Realm getRealm()
setRealm
- public void setRealm(Realm new_nameRealm)
- throws RealmException
Throws:
setRealm
- public void setRealm(java.lang.String realmsString)
- throws RealmException
Throws:
getSalt
- public java.lang.String getSalt( )
setSalt
- public void setSalt(java.lang.String salt)
toString
- public java.lang.String toString( )
Overrides:
toString
in class java.lang.Object
getNameString
- public java.lang.String getNameString( )
asn1Encode
- public byte[] asn1Encode()
- throws Asn1Exception
- java.io.IOException
Encodes a
PrincipalName
object.
Returns:
the byte array of the encoded PrncipalName object.
Throws:
Asn1Exception
- if an error occurs while decoding an ASN1 encoded data. java.io.IOException
- if an I/O error occurs while reading encoded data. match
- public boolean match(PrincipalName pname)
Checks if two
PrincipalName
objects have identical values in their corresponding data fields.
Parameters:
pname
- the other PrincipalName
object. Returns:
true if two have identical values, otherwise, return false.
writePrincipal
- public void writePrincipal(CCacheOutputStream cos)
- throws java.io.IOException
Writes data field values of
PrincipalName
in FCC format to an output stream.
Parameters:
cos
- a CCacheOutputStream
for writing data. Throws:
java.io.IOException
- if an I/O exception occurs. See Also:
getInstanceComponent
- public java.lang.String getInstanceComponent( )
Returns the instance component of a name.
In a multi-component name such as a KRB_NT_SRV_INST
name, the second component is returned.
Null is returned if there are not two or more
components in the name.
isTGS
- public boolean isTGS()
Determines whether this is a ticket-granting service
based on the name. A ticket-granting service name consists of
two parts with the first part being "krbtgt".