| java.lang.Object |
| ↳ |
sun.security.mule.krb5.PrincipalName |
Known Direct Subclasses
|
Class Overview
This class encapsulates a Kerberos principal.
Summary
| Protected Constructors |
|
|
PrincipalName()
|
|
|
PrincipalName(String primary, String instance, String realm, int type)
Creates a KRB_NT_SRV_INST name from the supplied
name components and realm.
|
| Protected Methods |
|
static
String[]
|
parseName(String name)
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
public
static
final
int
KRB_NT_PRINCIPAL
Just the name of the principal as in DCE, or for users
Constant Value:
1
(0x00000001)
public
static
final
int
KRB_NT_SRV_HST
Service with host name as instance (telnet, rcommands)
Constant Value:
3
(0x00000003)
public
static
final
int
KRB_NT_SRV_INST
Service and other unique instance (krbtgt)
Constant Value:
2
(0x00000002)
public
static
final
int
KRB_NT_SRV_XHST
Service with host as remaining components
Constant Value:
4
(0x00000004)
public
static
final
int
KRB_NT_UID
Constant Value:
5
(0x00000005)
public
static
final
int
KRB_NT_UNKNOWN
Constant Value:
0
(0x00000000)
public
static
final
char
NAME_COMPONENT_SEPARATOR
Constant Value:
47
(0x0000002f)
public
static
final
String
NAME_COMPONENT_SEPARATOR_STR
public
static
final
char
NAME_REALM_SEPARATOR
Constant Value:
64
(0x00000040)
public
static
final
String
NAME_REALM_SEPARATOR_STR
public
static
final
char
REALM_COMPONENT_SEPARATOR
Constant Value:
46
(0x0000002e)
public
static
final
String
REALM_COMPONENT_SEPARATOR_STR
public
static
final
int
TGS_DEFAULT_NT
Constant Value:
2
(0x00000002)
public
static
final
String
TGS_DEFAULT_SRV_NAME
Fields
private
String[]
nameStrings
Public Constructors
public
PrincipalName
(String[] nameParts, int type)
Throws
| IOException
| |
| IllegalArgumentException
| |
public
PrincipalName
(String[] nameParts)
public
PrincipalName
(DerValue encoding)
Returns the ASN.1 encoding of the
PrincipalName ::= SEQUENCE {
name-type [0] Int32,
name-string [1] SEQUENCE OF KerberosString
}
KerberosString ::= GeneralString (IA5String)
This definition reflects the Network Working Group RFC 4120
specification available at
http://www.ietf.org/rfc/rfc4120.txt.
Parameters
| encoding
| A Der-encoded data. |
Throws
| Asn1Exception
| if an error occurs while decoding
an ASN1 encoded data. |
| Asn1Exception
| if there is an ASN1 encoding error |
| IOException
| if an I/O error occurs |
| IllegalArgumentException
| if encoding is null
reading encoded data.
|
public
PrincipalName
(String name, int type, Config kerberosConfig)
public
PrincipalName
(String name, Config kerberosConfig)
public
PrincipalName
(String name, String realm, Config kerberosConfig)
Parameters
| name
| |
| realm
| |
| kerberosConfig
| |
Protected Constructors
protected
PrincipalName
()
protected
PrincipalName
(String primary, String instance, String realm, int type)
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 |
| type
| |
Public Methods
public
byte[]
asn1Encode
()
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. |
| IOException
| if an I/O error occurs while reading encoded data.
|
public
boolean
equals
(Object o)
public
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.
public
String
getNameString
()
public
String[]
getNameStrings
()
public
int
getNameType
()
public
String
getPrincipalNameAsString
()
public
String
getRealmAsString
()
public
String
getRealmString
()
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.
public
static
PrincipalName
parse
(DerInputStream data, byte explicitTag, boolean optional)
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.
public
void
setRealm
(String realmsString)
public
void
setRealm
(Realm new_nameRealm)
public
void
setSalt
(String salt)
public
byte[][]
toByteArray
()
public
String
toString
()
Writes data field values of PrincipalName in FCC format to an output stream.
Parameters
| cos
| A CCacheOutputStream for writing data. |
Throws
| IOException
| if an I/O exception occurs. |
Protected Methods
protected
static
String[]
parseName
(String name)