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

public Class Ticket

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
sun.security.krb5.PrincipalName, .EncryptedData, .Asn1Exception, .Realm, .RealmException, sun.security.util.*, java.io.IOException, java.math.BigInteger

Implements the ASN.1 Ticket type.
Ticket               ::= [APPLICATION 1] SEQUENCE {
     tkt-vno         [0] INTEGER (5),
     realm           [1] Realm,
     sname           [2] PrincipalName,
     enc-part        [3] EncryptedData -- EncTicketPart
}

This definition reflects the Network Working Group RFC 4120 specification available at http://www.ietf.org/rfc/rfc4120.txt.

Field Summary

Modifier and TypeField and Description
public EncryptedData
public PrincipalName
public int

Constructor Summary

AccessConstructor and Description
private
public
Ticket(PrincipalName new_sname, EncryptedData new_encPart)

public
Ticket(byte[] data)

public
Ticket(DerValue encoding)

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

byte array of encoded ticket object.
asn1Encode
()

Encodes a Ticket object.

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

private void
init(DerValue
a single DER-encoded value.
encoding
)

Initializes a Ticket object.

public static Ticket

Returns:

an instance of Ticket.
parse
(DerInputStream
the Der input stream value, which contains one or more marshaled value.
data
,
byte
tag number.
explicitTag
,
boolean
indicate if this data field is optional
optional
)

Parse (unmarshal) a Ticket from a DER input stream.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encPartback to summary
public EncryptedData encPart
snameback to summary
public PrincipalName sname
tkt_vnoback to summary
public int tkt_vno

Constructor Detail

Ticketback to summary
private Ticket()
Ticketback to summary
public Ticket(PrincipalName new_sname, EncryptedData new_encPart)
Ticketback to summary
public Ticket(byte[] data) throws Asn1Exception, RealmException, KrbApErrException, IOException
Ticketback to summary
public Ticket(DerValue encoding) throws Asn1Exception, RealmException, KrbApErrException, IOException

Method Detail

asn1Encodeback to summary
public byte[] asn1Encode() throws Asn1Exception, IOException

Encodes a Ticket object.

Returns:byte[]

byte array of encoded ticket object.

Exceptions
Asn1Exception:
if an error occurs while decoding an ASN1 encoded data.
IOException:
if an I/O error occurs while reading encoded data.
cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

initback to summary
private void init(DerValue encoding) throws Asn1Exception, RealmException, KrbApErrException, IOException

Initializes a Ticket object.

Parameters
encoding:DerValue

a single DER-encoded value.

Exceptions
Asn1Exception:
if an error occurs while decoding an ASN1 encoded data.
RealmException:
if an error occurs while parsing a Realm object.
KrbApErrException:
if the value read from the DER-encoded data stream does not match the pre-defined value.
IOException:
if an I/O error occurs while reading encoded data.
parseback to summary
public static Ticket parse(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException, RealmException, KrbApErrException

Parse (unmarshal) a Ticket 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:DerInputStream

the Der input stream value, which contains one or more marshaled value.

explicitTag:byte

tag number.

optional:boolean

indicate if this data field is optional

Returns:Ticket

an instance of Ticket.

Exceptions
Asn1Exception:
on error.