APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.jgss.krb5

public final Class ServiceCreds

extends Object
Class Inheritance
Imports
javax.security.auth.kerberos.KerberosTicket, .KerberosKey, .KerberosPrincipal, .KeyTab, javax.security.auth.Subject, sun.security.krb5.Credentials, .EncryptionKey, .KrbException, sun.security.krb5.*, java.io.IOException, java.util.ArrayList, .Collections, .List, .Set, sun.security.krb5.internal.Krb5

Credentials of a kerberos acceptor. A KerberosPrincipal object (kp) is the principal. It can be specified as the serverPrincipal argument in the getInstance() method, or uses only KerberosPrincipal in the subject. Otherwise, the creds object is unbound and kp is null. The class also encapsulates various secrets, which can be: 1. Some KerberosKeys (generated from password) 2. Some KeyTabs (for a typical service based on keytabs) 3. A TGT (for S4U2proxy extension or user2user) Note that some secrets can coexist. For example, a user2user service can use its keytab (or keys) if the client can successfully obtain a normal service ticket, or it can use the TGT (actually, the session key of the TGT) if the client can only acquire a service ticket of ENC-TKT-IN-SKEY style.
Since
1.8

Field Summary

Modifier and TypeField and Description
private Set<KerberosPrincipal>
private boolean
private List<KerberosKey>
private KerberosPrincipal
private List<KeyTab>
private KerberosTicket

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public EncryptionKey[]

Returns:

keys for the princ, never null, might be empty
getEKeys
(PrincipalName
the target name initiator requests. Not null.
princ
)

Gets EKeys for a principal.

public Credentials
public static ServiceCreds

Returns:

the object, or null if there is no private creds for it
getInstance
(Subject subj, String serverPrincipal)

Creates a ServiceCreds object based on info in a Subject for a given principal name (if specified).

public KerberosKey[]
getKKeys()

Gets keys for "someone".

public KerberosKey[]

Returns:

keys for the princ, never null, might be empty
getKKeys
(KerberosPrincipal
the target name initiator requests. Not null.
princ
)

Get kkeys for a principal,

public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allPrincsback to summary
private Set<KerberosPrincipal> allPrincs
destroyedback to summary
private boolean destroyed
kkback to summary
private List<KerberosKey> kk
kpback to summary
private KerberosPrincipal kp
ktabsback to summary
private List<KeyTab> ktabs
tgtback to summary
private KerberosTicket tgt

Constructor Detail

ServiceCredsback to summary
private ServiceCreds()

Method Detail

destroyback to summary
public void destroy()
getEKeysback to summary
public EncryptionKey[] getEKeys(PrincipalName princ)

Gets EKeys for a principal.

Parameters
princ:PrincipalName

the target name initiator requests. Not null.

Returns:EncryptionKey[]

keys for the princ, never null, might be empty

getInitCredback to summary
public Credentials getInitCred()
getInstanceback to summary
public static ServiceCreds getInstance(Subject subj, String serverPrincipal)

Creates a ServiceCreds object based on info in a Subject for a given principal name (if specified).

Returns:ServiceCreds

the object, or null if there is no private creds for it

getKKeysback to summary
public KerberosKey[] getKKeys()

Gets keys for "someone". Used in 2 cases: 1. By TLS because it needs to get keys before client comes in. 2. As a fallback in getEKeys() below. This method can still return an empty array.

getKKeysback to summary
public KerberosKey[] getKKeys(KerberosPrincipal princ)

Get kkeys for a principal,

Parameters
princ:KerberosPrincipal

the target name initiator requests. Not null.

Returns:KerberosKey[]

keys for the princ, never null, might be empty

getNameback to summary
public String getName()