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

public Class PAData

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, sun.security.krb5.Asn1Exception, sun.security.krb5.internal.util.KerberosString, sun.security.krb5.internal.crypto.EType, sun.security.util.*

Implements the ASN.1 PA-DATA type.
PA-DATA         ::= SEQUENCE {
        -- NOTE: first tag is [1], not [0]
        padata-type     [1] Int32,
        padata-value    [2] OCTET STRING -- might be encoded AP-REQ
}

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PAData.SaltAndParams

A place to store a pair of salt and s2kparams.

Field Summary

Modifier and TypeField and Description
private int
private byte[]
private static final byte
private static final byte

Constructor Summary

AccessConstructor and Description
private
public
PAData(int new_pADataType, byte[] new_pADataValue)

public
PAData(DerValue
a Der-encoded data.
encoding
)

Constructs a PAData object.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

byte array of the encoded data.
asn1Encode
()

Encodes this object to an OutputStream.

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public static int

Returns:

the etype, or defaultEType if not enough info
getPreferredEType
(PAData[] pas, int defaultEType)

Gets the preferred etype from the PAData array.

public static PAData.SaltAndParams

Returns:

salt and s2kparams. can be null if not found
getSaltAndParams
(int eType, PAData[] pas)

Fetches salt and s2kparams value for eType in a series of PA-DATAs.

public int
public byte[]
public static PAData[]

Returns:

an array of PAData.
parseSequence
(DerInputStream
the Der input stream value, which contains one or more marshaled values.
data
,
byte
tag number.
explicitTag
,
boolean
indicates if this data field is optional.
optional
)

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

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

pADataTypeback to summary
private int pADataType
pADataValueback to summary
private byte[] pADataValue
TAG_PATYPEback to summary
private static final byte TAG_PATYPE
TAG_PAVALUEback to summary
private static final byte TAG_PAVALUE

Constructor Detail

PADataback to summary
private PAData()
PADataback to summary
public PAData(int new_pADataType, byte[] new_pADataValue)
PADataback to summary
public PAData(DerValue encoding) throws Asn1Exception, IOException

Constructs a PAData object.

Parameters
encoding:DerValue

a Der-encoded data.

Exceptions
Asn1Exception:
if an error occurs while decoding an ASN1 encoded data.
IOException:
if an I/O error occurs while reading encoded data.

Method Detail

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

Encodes this object to an OutputStream.

Returns:byte[]

byte array of the encoded data.

Exceptions
Asn1Exception:
on encoding errors.
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.

getPreferredETypeback to summary
public static int getPreferredEType(PAData[] pas, int defaultEType) throws IOException, Asn1Exception

Gets the preferred etype from the PAData array.

  1. ETYPE-INFO2-ENTRY with unknown s2kparams ignored
  2. ETYPE-INFO2 preferred to ETYPE-INFO
  3. Multiple entries for same etype in one PA-DATA, use the first one.
  4. Multiple PA-DATA with same type, choose the last one.
(This is useful when PA-DATAs from KRB-ERROR and AS-REP are combined).
Returns:int

the etype, or defaultEType if not enough info

Exceptions
IOException:
if there is an encoding error
Asn1Exception:
if there is an encoding error
getSaltAndParamsback to summary
public static PAData.SaltAndParams getSaltAndParams(int eType, PAData[] pas) throws Asn1Exception, IOException

Fetches salt and s2kparams value for eType in a series of PA-DATAs. 1. ETYPE-INFO2-ENTRY with unknown s2kparams ignored 2. PA-ETYPE-INFO2 preferred to PA-ETYPE-INFO preferred to PA-PW-SALT. 3. multiple entries for same etype in one PA-DATA, use the first one. 4. Multiple PA-DATA with same type, choose the last one (This is useful when PA-DATAs from KRB-ERROR and AS-REP are combined).

Returns:PAData.SaltAndParams

salt and s2kparams. can be null if not found

getTypeback to summary
public int getType()
getValueback to summary
public byte[] getValue()
parseSequenceback to summary
public static PAData[] parseSequence(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException

Parse (unmarshal) a PAData 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 values.

explicitTag:byte

tag number.

optional:boolean

indicates if this data field is optional.

Returns:PAData[]

an array of PAData.

Exceptions
Asn1Exception:
if an Asn1Exception occurs.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
sun.security.krb5.internal back to summary

public Class PAData.SaltAndParams

extends Object
Class Inheritance

A place to store a pair of salt and s2kparams. An empty salt is changed to null, to be interoperable with Windows 2000 server. This is in fact not correct.

Field Summary

Modifier and TypeField and Description
public final byte[]
public final String

Constructor Summary

AccessConstructor and Description
public
SaltAndParams(String s, byte[] p)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

paramsback to summary
public final byte[] params
saltback to summary
public final String salt

Constructor Detail

SaltAndParamsback to summary
public SaltAndParams(String s, byte[] p)