Top Description Fields Constructors Methods
sun.security.krb5

public Class KrbApReq

extends Object
Class Inheritance
Imports
sun.security.krb5.internal.*, sun.security.krb5.internal.crypto.*, sun.security.jgss.krb5.Krb5AcceptCredential, java.net.InetAddress, sun.security.util.*, java.io.IOException, java.util.Arrays, java.security.MessageDigest, .NoSuchAlgorithmException, sun.security.krb5.internal.rcache.AuthTimeWithHash

This class encapsulates a KRB-AP-REQ that a client sends to a server for authentication.

Field Summary

Modifier and TypeField and Description
private APReq
private Authenticator
private Credentials
private KerberosTime
private int
private static final char[]
private byte[]
private static ReplayCache

Constructor Summary

AccessConstructor and Description
public
KrbApReq(Credentials
the Credentials to be used to construct the AP Request protocol message.
tgsCred
,
boolean
Whether mutual authentication is required
mutualRequired
,
boolean
Whether the subkey is to be used to protect this specific application session. If this is not set then the session key from the ticket will be used.
useSubKey
,
boolean useSeqNumber, Checksum
checksum of the application data that accompanies the KRB_AP_REQ.
cksum
)

Constructs an AP-REQ message to send to the peer.

public
KrbApReq(byte[]
The message received from the peer
message
,
Krb5AcceptCredential
KrbAcceptCredential containing keys to decrypt the message; key selected will depend on etype used to encrypt data
cred
,
InetAddress initiator)

Constructs an AP-REQ message from the bytes received from the peer.

pack-priv
KrbApReq(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData)

used by KrbTgsReq

Method Summary

Modifier and TypeMethod and Description
private void
private static void
checkPermittedEType(int target)

private void
createMessage(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage)

pack-priv int
pack-priv void
pack-priv void
decode(DerValue encoding)

pack-priv APOptions
public Checksum
getChecksum()

Returns the optional Checksum stored in the Authenticator for this message.

public PrincipalName
getClient()

Returns the principal name of the client that generated this message.

public Credentials
getCreds()

Returns the credentials that are contained in the ticket that is part of this AP-REQ.

pack-priv KerberosTime
public byte[]
getMessage()

Returns the ASN.1 encoding that should be sent to the peer.

public boolean
getMutualAuthRequired()

Returns true if mutual authentication is required and hence an AP-REP will need to be generated.

public Integer
getSeqNumber()

Returns the optional sequence number stored in the Authenticator for this message.

public EncryptionKey
getSubKey()

Returns the optional subkey stored in the Authenticator for this message.

private void
init(APOptions options, Credentials tgs_creds, Checksum cksum, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage)

private void
init(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage)

pack-priv boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

apReqMessgback to summary
private APReq apReqMessg
authenticatorback to summary
private Authenticator authenticator
credsback to summary
private Credentials creds
ctimeback to summary
private KerberosTime ctime
cusecback to summary
private int cusec
hexConstback to summary
private static final char[] hexConst
obufback to summary
private byte[] obuf
rcacheback to summary
private static ReplayCache rcache

Constructor Detail

KrbApReqback to summary
public KrbApReq(Credentials tgsCred, boolean mutualRequired, boolean useSubKey, boolean useSeqNumber, Checksum cksum) throws Asn1Exception, KrbCryptoException, KrbException, IOException

Constructs an AP-REQ message to send to the peer.

Parameters
tgsCred:Credentials

the Credentials to be used to construct the AP Request protocol message.

mutualRequired:boolean

Whether mutual authentication is required

useSubKey:boolean

Whether the subkey is to be used to protect this specific application session. If this is not set then the session key from the ticket will be used.

cksum:Checksum

checksum of the application data that accompanies the KRB_AP_REQ.

Exceptions
KrbException:
for any Kerberos protocol specific error
IOException:
for any IO related errors (e.g. socket operations)
KrbApReqback to summary
public KrbApReq(byte[] message, Krb5AcceptCredential cred, InetAddress initiator) throws KrbException, IOException

Constructs an AP-REQ message from the bytes received from the peer.

Parameters
message:byte[]

The message received from the peer

cred:Krb5AcceptCredential

KrbAcceptCredential containing keys to decrypt the message; key selected will depend on etype used to encrypt data

Exceptions
KrbException:
for any Kerberos protocol specific error
IOException:
for any IO related errors (e.g. socket operations)
KrbApReqback to summary
pack-priv KrbApReq(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData) throws Asn1Exception, IOException, KdcErrException, KrbCryptoException

used by KrbTgsReq

Method Detail

authenticateback to summary
private void authenticate(Krb5AcceptCredential cred, InetAddress initiator) throws KrbException, IOException
checkPermittedETypeback to summary
private static void checkPermittedEType(int target) throws KrbException
createMessageback to summary
private void createMessage(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage) throws Asn1Exception, IOException, KdcErrException, KrbCryptoException
cusecback to summary
pack-priv int cusec()
decodeback to summary
pack-priv void decode() throws KrbException, IOException
decodeback to summary
pack-priv void decode(DerValue encoding) throws KrbException, IOException
getAPOptionsback to summary
pack-priv APOptions getAPOptions() throws KrbException, IOException
getChecksumback to summary
public Checksum getChecksum()

Returns the optional Checksum stored in the Authenticator for this message. Returns null if none is stored.

getClientback to summary
public PrincipalName getClient()

Returns the principal name of the client that generated this message.

getCredsback to summary
public Credentials getCreds()

Returns the credentials that are contained in the ticket that is part of this AP-REQ.

getCtimeback to summary
pack-priv KerberosTime getCtime()
getMessageback to summary
public byte[] getMessage()

Returns the ASN.1 encoding that should be sent to the peer.

getMutualAuthRequiredback to summary
public boolean getMutualAuthRequired() throws KrbException, IOException

Returns true if mutual authentication is required and hence an AP-REP will need to be generated.

getSeqNumberback to summary
public Integer getSeqNumber()

Returns the optional sequence number stored in the Authenticator for this message. Returns null if none is stored.

getSubKeyback to summary
public EncryptionKey getSubKey()

Returns the optional subkey stored in the Authenticator for this message. Returns null if none is stored.

initback to summary
private void init(APOptions options, Credentials tgs_creds, Checksum cksum, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage) throws KrbException, IOException
initback to summary
private void init(APOptions apOptions, Ticket ticket, EncryptionKey key, PrincipalName cname, Checksum cksum, KerberosTime ctime, EncryptionKey subKey, SeqNumber seqNumber, AuthorizationData authorizationData, int usage) throws Asn1Exception, IOException, KdcErrException, KrbCryptoException
useSessionKeyback to summary
pack-priv boolean useSessionKey() throws KrbException, IOException