Package Summary  Overview Summary

class:EncryptionKey [NONE]

  • All Implemented Interfaces:
    Serializable, Key, SecretKey, Destroyable

    public final class EncryptionKey
    extends Object
    implements SecretKey
    This class encapsulates an EncryptionKey used in Kerberos.

    An EncryptionKey is defined in Section 4.2.9 of the Kerberos Protocol Specification (RFC 4120 ) as:

         EncryptionKey   ::= SEQUENCE {
                 keytype         [0] Int32 -- actually encryption type --,
                 keyvalue        [1] OCTET STRING
    The key material of an EncryptionKey is defined as the value of the keyValue above.

    See Also:
    Serialized Form

constructor:<init>(byte[],int) [NONE]

  • EncryptionKey

    public EncryptionKey​(byte[] keyBytes,
                         int keyType)
    Constructs an EncryptionKey from the given bytes and the key type.

    The contents of the byte array are copied; subsequent modification of the byte array does not affect the newly created key.

    keyBytes - the key material for the key
    keyType - the key type for the key as defined by the Kerberos protocol specification.
    NullPointerException - if keyBytes is null

method:getKeyType() [NONE]

  • getKeyType

    public int getKeyType()
    Returns the key type for this key.
    the key type.
    IllegalStateException - if the key is destroyed

method:getAlgorithm() [NONE]

  • getAlgorithm

    public String getAlgorithm()
    Returns the standard algorithm name for this key. The algorithm names are the encryption type string defined on the IANA Kerberos Encryption Type Numbers page.

    This method can return the following value not defined on the IANA page:

    1. none: for etype equal to 0
    2. unknown: for etype greater than 0 but unsupported by the implementation
    3. private: for etype smaller than 0

    Specified by:
    getAlgorithm in interface Key
    the name of the algorithm associated with this key.
    IllegalStateException - if the key is destroyed

method:getFormat() [NONE]

  • getFormat

    public String getFormat()
    Returns the name of the encoding format for this key.
    Specified by:
    getFormat in interface Key
    the String "RAW"
    IllegalStateException - if the key is destroyed

method:getEncoded() [NONE]

  • getEncoded

    public byte[] getEncoded()
    Returns the key material of this key.
    Specified by:
    getEncoded in interface Key
    a newly allocated byte array that contains the key material
    IllegalStateException - if the key is destroyed

method:destroy() [NONE]

method:isDestroyed() [NONE]

  • isDestroyed

    public boolean isDestroyed()
    Description copied from interface: Destroyable
    Determine if this Object has been destroyed.
    Specified by:
    isDestroyed in interface Destroyable
    true if this Object has been destroyed, false otherwise.

method:toString() [NONE]

  • toString

    public String toString()
    Returns an informative textual representation of this EncryptionKey.
    toString in class Object
    an informative textual representation of this EncryptionKey.

method:hashCode() [NONE]

method:equals(java.lang.Object) [NONE]

  • equals

    public boolean equals​(Object other)
    Compares the specified object with this key for equality. Returns true if the given object is also an EncryptionKey and the two EncryptionKey instances are equivalent. More formally two EncryptionKey instances are equal if they have equal key types and key material. A destroyed EncryptionKey object is only equal to itself.
    equals in class Object
    other - the object to compare to
    true if the specified object is equal to this EncryptionKey, false otherwise.
    See Also:
    Object.hashCode(), HashMap

© 2019 Oracle Corporation and/or its affiliates