Uses of Interface
java.security.Key

Packages that useKey
Package
Description
java.security
Provides the classes and interfaces for the security framework.
java.security.interfaces
Provides interfaces for generating RSA (Rivest, Shamir and Adleman AsymmetricCipher algorithm) keys as defined in the RSA Laboratory Technical Note PKCS#1, and DSA (Digital Signature Algorithm) keys as defined in NIST's FIPS-186.
javax.crypto
Provides the classes and interfaces for cryptographic operations.
javax.crypto.interfaces
Provides interfaces for Diffie-Hellman keys as defined in RSA Laboratories' PKCS #3.
javax.crypto.spec
Provides classes and interfaces for key specifications and algorithm parameter specifications.
javax.security.auth.kerberos
This package contains utility classes related to the Kerberos network authentication protocol.
javax.xml.crypto
Common classes for XML cryptography.
javax.xml.crypto.dsig.dom
DOM-specific classes for thejavax.xml.crypto.dsig package.
  • Uses ofKey injava.security

    Subinterfaces ofKey injava.security
    Modifier and Type
    Interface
    Description
    interface 
    An asymmetric key, which can be either a public key or a private key.
    interface 
    A private key.
    interface 
    A public key.
    Methods injava.security that returnKey
    Modifier and Type
    Method
    Description
    abstractKey
    KeyStoreSpi.engineGetKey(String alias, char[] password)
    Returns the key associated with the given alias, using the given password to recover it.
    protected abstractKey
    KeyFactorySpi.engineTranslateKey(Key key)
    Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
    finalKey
    KeyStore.getKey(String alias, char[] password)
    Returns the key associated with the given alias, using the given password to recover it.
    finalKey
    KeyFactory.translateKey(Key key)
    Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
    Methods injava.security with parameters of typeKey
    Modifier and Type
    Method
    Description
    protected abstract <T extendsKeySpec>
    T
    KeyFactorySpi.engineGetKeySpec(Key key,Class<T> keySpec)
    Returns a specification (key material) of the given key object.
    abstract void
    KeyStoreSpi.engineSetKeyEntry(String alias,Key key, char[] password,Certificate[] chain)
    Assigns the given key to the given alias, protecting it with the given password.
    protected abstractKey
    KeyFactorySpi.engineTranslateKey(Key key)
    Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
    final <T extendsKeySpec>
    T
    KeyFactory.getKeySpec(Key key,Class<T> keySpec)
    Returns a specification (key material) of the given key object.
    boolean
    AlgorithmConstraints.permits(Set<CryptoPrimitive> primitives,String algorithm,Key key,AlgorithmParameters parameters)
    Determines whether an algorithm and the corresponding key are granted permission for the specified cryptographic primitives.
    boolean
    AlgorithmConstraints.permits(Set<CryptoPrimitive> primitives,Key key)
    Determines whether a key is granted permission for the specified cryptographic primitives.
    final void
    KeyStore.setKeyEntry(String alias,Key key, char[] password,Certificate[] chain)
    Assigns the given key to the given alias, protecting it with the given password.
    finalKey
    KeyFactory.translateKey(Key key)
    Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
  • Uses ofKey injava.security.interfaces

    Subinterfaces ofKey injava.security.interfaces
    Modifier and Type
    Interface
    Description
    interface 
    The standard interface to a DSA private key.
    interface 
    The interface to a DSA public key.
    interface 
    The interface to an elliptic curve (EC) private key.
    interface 
    The interface to an elliptic curve (EC) public key.
    interface 
    An interface for an elliptic curve private key as defined byRFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA).
    interface 
    An interface for an elliptic curve public key as defined byRFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA).
    interface 
    The interface to an RSA multi-prime private key, as defined in thePKCS#1 v2.2 standard, using theChinese Remainder Theorem (CRT) information values.
    interface 
    The interface to an RSA private key, as defined in thePKCS#1 v2.2 standard, using theChinese Remainder Theorem (CRT) information values.
    interface 
    The interface to an RSA private key.
    interface 
    The interface to an RSA public key.
    interface 
    An interface for an elliptic curve private key as defined by RFC 7748.
    interface 
    An interface for an elliptic curve public key as defined by RFC 7748.
  • Uses ofKey injavax.crypto

    Subinterfaces ofKey injavax.crypto
    Modifier and Type
    Interface
    Description
    interface 
    A secret (symmetric) key.
    Methods injavax.crypto that returnKey
    Modifier and Type
    Method
    Description
    finalKey
    KeyAgreement.doPhase(Key key, boolean lastPhase)
    Executes the next phase of this key agreement with the given key that was received from one of the other parties involved in this key agreement.
    protected abstractKey
    KeyAgreementSpi.engineDoPhase(Key key, boolean lastPhase)
    Executes the next phase of this key agreement with the given key that was received from one of the other parties involved in this key agreement.
    protectedKey
    CipherSpi.engineUnwrap(byte[] wrappedKey,String wrappedKeyAlgorithm, int wrappedKeyType)
    Unwrap a previously wrapped key.
    finalKey
    Cipher.unwrap(byte[] wrappedKey,String wrappedKeyAlgorithm, int wrappedKeyType)
    Unwrap a previously wrapped key.
    Methods injavax.crypto with parameters of typeKey
    Modifier and Type
    Method
    Description
    finalKey
    KeyAgreement.doPhase(Key key, boolean lastPhase)
    Executes the next phase of this key agreement with the given key that was received from one of the other parties involved in this key agreement.
    protected abstractKey
    KeyAgreementSpi.engineDoPhase(Key key, boolean lastPhase)
    Executes the next phase of this key agreement with the given key that was received from one of the other parties involved in this key agreement.
    protected int
    CipherSpi.engineGetKeySize(Key key)
    Returns the key size of the given key object in bits.
    protected abstract void
    CipherSpi.engineInit(int opmode,Key key,AlgorithmParameters params,SecureRandom random)
    Initializes thisCipherSpi object with a key, a set of algorithm parameters, and a source of randomness.
    protected abstract void
    CipherSpi.engineInit(int opmode,Key key,SecureRandom random)
    Initializes thisCipherSpi object with a key and a source of randomness.
    protected abstract void
    CipherSpi.engineInit(int opmode,Key key,AlgorithmParameterSpec params,SecureRandom random)
    Initializes thisCipherSpi object with a key, a set of algorithm parameters, and a source of randomness.
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key)
    Initializes this exemption mechanism with a key.
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key,AlgorithmParameters params)
    Initializes this exemption mechanism with a key and a set of algorithm parameters.
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key,AlgorithmParameterSpec params)
    Initializes this exemption mechanism with a key and a set of algorithm parameters.
    protected abstract void
    KeyAgreementSpi.engineInit(Key key,SecureRandom random)
    Initializes this key agreement with the given key and source of randomness.
    protected abstract void
    KeyAgreementSpi.engineInit(Key key,AlgorithmParameterSpec params,SecureRandom random)
    Initializes this key agreement with the given key, set of algorithm parameters, and source of randomness.
    protected abstract void
    Initializes the MAC with the given (secret) key and algorithm parameters.
    protected byte[]
    CipherSpi.engineWrap(Key key)
    Wrap a key.
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey)
    Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey,String providerName)
    Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey,Provider provider)
    Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
    finalObject
    SealedObject.getObject(Key key)
    Retrieves the original (encapsulated) object.
    finalObject
    SealedObject.getObject(Key key,String provider)
    Retrieves the original (encapsulated) object.
    final void
    Cipher.init(int opmode,Key key)
    Initializes thisCipher object with a key.
    final void
    Cipher.init(int opmode,Key key,AlgorithmParameters params)
    Initializes thisCipher object with a key and a set of algorithm parameters.
    final void
    Cipher.init(int opmode,Key key,AlgorithmParameters params,SecureRandom random)
    Initializes thisCipher object with a key, a set of algorithm parameters, and a source of randomness.
    final void
    Cipher.init(int opmode,Key key,SecureRandom random)
    Initializes thisCipher object with a key and a source of randomness.
    final void
    Cipher.init(int opmode,Key key,AlgorithmParameterSpec params)
    Initializes thisCipher object with a key and a set of algorithm parameters.
    final void
    Cipher.init(int opmode,Key key,AlgorithmParameterSpec params,SecureRandom random)
    Initializes thisCipher object with a key, a set of algorithm parameters, and a source of randomness.
    final void
    ExemptionMechanism.init(Key key)
    Initializes this exemption mechanism with a key.
    final void
    ExemptionMechanism.init(Key key,AlgorithmParameters params)
    Initializes this exemption mechanism with a key and a set of algorithm parameters.
    final void
    ExemptionMechanism.init(Key key,AlgorithmParameterSpec params)
    Initializes this exemption mechanism with a key and a set of algorithm parameters.
    final void
    KeyAgreement.init(Key key)
    Initializes this key agreement with the given key, which is required to contain all the algorithm parameters required for this key agreement.
    final void
    KeyAgreement.init(Key key,SecureRandom random)
    Initializes this key agreement with the given key and source of randomness.
    final void
    KeyAgreement.init(Key key,AlgorithmParameterSpec params)
    Initializes this key agreement with the given key and set of algorithm parameters.
    final void
    KeyAgreement.init(Key key,AlgorithmParameterSpec params,SecureRandom random)
    Initializes this key agreement with the given key, set of algorithm parameters, and source of randomness.
    final void
    Mac.init(Key key)
    Initializes thisMac object with the given key.
    final void
    Mac.init(Key key,AlgorithmParameterSpec params)
    Initializes thisMac object with the given key and algorithm parameters.
    final boolean
    ExemptionMechanism.isCryptoAllowed(Key key)
    Returns whether the result blob has been generated successfully by this exemption mechanism.
    final byte[]
    Cipher.wrap(Key key)
    Wrap a key.
  • Uses ofKey injavax.crypto.interfaces

    Subinterfaces ofKey injavax.crypto.interfaces
    Modifier and Type
    Interface
    Description
    interface 
    The interface to a Diffie-Hellman private key.
    interface 
    The interface to a Diffie-Hellman public key.
    interface 
    The interface to a PBE key.
  • Uses ofKey injavax.crypto.spec

    Classes injavax.crypto.spec that implementKey
    Modifier and Type
    Class
    Description
    class 
    This class specifies a secret key in a provider-independent fashion.
  • Uses ofKey injavax.security.auth.kerberos

    Classes injavax.security.auth.kerberos that implementKey
    Modifier and Type
    Class
    Description
    final class 
    This class encapsulates an EncryptionKey used in Kerberos.
    class 
    This class encapsulates a long term secret key for a Kerberos principal.
  • Uses ofKey injavax.xml.crypto

    Methods injavax.xml.crypto that returnKey
    Modifier and Type
    Method
    Description
    KeySelectorResult.getKey()
    Returns the selected key.
    Methods injavax.xml.crypto with parameters of typeKey
    Modifier and Type
    Method
    Description
    KeySelector.singletonKeySelector(Key key)
    Returns aKeySelector that always selects the specified key, regardless of theKeyInfo passed to it.
  • Uses ofKey injavax.xml.crypto.dsig.dom

    Constructors injavax.xml.crypto.dsig.dom with parameters of typeKey
    Modifier
    Constructor
    Description
     
    DOMSignContext(Key signingKey,Node parent)
    Creates aDOMSignContext with the specified signing key and parent node.
     
    DOMSignContext(Key signingKey,Node parent,Node nextSibling)
    Creates aDOMSignContext with the specified signing key, parent and next sibling nodes.
     
    DOMValidateContext(Key validatingKey,Node node)
    Creates aDOMValidateContext containing the specified key and node.