|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.security.mule.krb5.EncryptionKey
public class EncryptionKey
This class encapsulates the concept of an EncryptionKey. An encryption key is defined in RFC 4120 as: EncryptionKey ::= SEQUENCE { keytype [0] Int32 -- actually encryption type --, keyvalue [1] OCTET STRING } keytype This field specifies the encryption type of the encryption key that follows in the keyvalue field. Although its name is "keytype", it actually specifies an encryption type. Previously, multiple cryptosystems that performed encryption differently but were capable of using keys with the same characteristics were permitted to share an assigned number to designate the type of key; this usage is now deprecated. keyvalue This field contains the key itself, encoded as an octet string.
| Field Summary | |
|---|---|
static EncryptionKey |
NULL_KEY
|
| Constructor Summary | |
|---|---|
EncryptionKey(byte[] keyValue,
int keyType,
Integer kvno)
|
|
EncryptionKey(char[] password,
String salt,
String algorithm)
|
|
EncryptionKey(sun.security.util.DerValue encoding)
Constructs an instance of EncryptionKey type. |
|
EncryptionKey(int keyType,
byte[] keyValue)
Constructs an EncryptionKey by using the specified key type and key value. |
|
| Method Summary | |
|---|---|
static EncryptionKey[] |
acquireSecretKeys(char[] password,
String salt,
boolean pa_exists,
int pa_etype,
byte[] pa_s2kparams,
Config kerberosConfig)
Generates a list of keys using the given principal, password, and the pre-authentication values. |
static EncryptionKey[] |
acquireSecretKeys(char[] password,
String salt,
Config kerberosConfig)
Generate a list of keys using the given principal and password. |
static EncryptionKey[] |
acquireSecretKeys(PrincipalName princ,
String keytab,
Config kerberosConfig)
Obtains all versions of the secret key of the principal from a keytab. |
byte[] |
asn1Encode()
Returns the ASN.1 encoding of this EncryptionKey. |
Object |
clone()
|
void |
destroy()
|
static EncryptionKey |
findKey(int etype,
EncryptionKey[] keys)
|
byte[] |
getBytes()
Returns the raw key bytes, not in any ASN.1 encoding. |
int |
getEType()
|
Integer |
getKeyVersionNumber()
|
static EncryptionKey |
parse(sun.security.util.DerInputStream data,
byte explicitTag,
boolean optional)
Parse (unmarshal) an Encryption key from a DER input stream. |
String |
toString()
|
void |
writeKey(CCacheOutputStream cos)
Writes key value in FCC format to a CCacheOutputStream. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final EncryptionKey NULL_KEY
| Constructor Detail |
|---|
public EncryptionKey(byte[] keyValue,
int keyType,
Integer kvno)
public EncryptionKey(int keyType,
byte[] keyValue)
public EncryptionKey(char[] password,
String salt,
String algorithm)
throws KrbCryptoException
KrbCryptoException
public EncryptionKey(sun.security.util.DerValue encoding)
throws Asn1Exception,
IOException
encoding - a single DER-encoded value.
Asn1Exception - if an error occurs while decoding an ASN1
encoded data.
IOException - if an I/O error occurs while reading encoded
data.| Method Detail |
|---|
public int getEType()
public final Integer getKeyVersionNumber()
public final byte[] getBytes()
public Object clone()
clone in class Object
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
String keytab,
Config kerberosConfig)
throws KrbException,
IOException
keytab - the path to the keytab file. A value of null
will be accepted to indicate that the default path should be
searched.
KrbException
IOException
public static EncryptionKey[] acquireSecretKeys(char[] password,
String salt,
Config kerberosConfig)
throws KrbException
KrbException
public static EncryptionKey[] acquireSecretKeys(char[] password,
String salt,
boolean pa_exists,
int pa_etype,
byte[] pa_s2kparams,
Config kerberosConfig)
throws KrbException
KrbException
public byte[] asn1Encode()
throws Asn1Exception,
IOException
This definition reflects the Network Working Group RFC 4120 specification available at http://www.ietf.org/rfc/rfc4120.txt.
Asn1Exception - if an error occurs while decoding an ASN1
encoded data.
IOException - if an I/O error occurs while reading encoded
data.public void destroy()
public static EncryptionKey parse(sun.security.util.DerInputStream data,
byte explicitTag,
boolean optional)
throws Asn1Exception,
IOException
data - the Der input stream value, which contains one or more
marshaled value.explicitTag - tag number.optional - indicate if this data field is optional
Asn1Exception - if an error occurs while decoding an ASN1
encoded data.
IOException - if an I/O error occurs while reading encoded
data.
public void writeKey(CCacheOutputStream cos)
throws IOException
CCacheOutputStream.
cos - a CCacheOutputStream to be written to.
IOException - if an I/O exception occurs.CCacheOutputStreampublic String toString()
toString in class Object
public static EncryptionKey findKey(int etype,
EncryptionKey[] keys)
throws KrbException
KrbException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||