javax.xml.crypto.enc.keyinfo
Interface EncryptedKey
-
- All Superinterfaces:
- EncryptedType, XMLStructure
public interface EncryptedKey extends EncryptedType
Represents theEncryptedKey
element. Its schema definition is as follows:
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
TYPE
URI identifying the EncryptedKey KeyInfo type: http://www.w3.org/2001/04/xmlenc#EncryptedKey.-
Fields inherited from interface javax.xml.crypto.enc.EncryptedType
CONTENT, ELEMENT, XMLNS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.io.InputStream
decrypt(XMLDecryptContext context)
Decrypts theCipherData
in thisEncryptedKey
.java.security.Key
decryptKey(XMLDecryptContext context, AlgorithmMethod alg)
Decrypts theCipherData
in thisEncryptedKey
and returns the decrypted key as aKey
object.java.lang.String
getCarriedKeyName()
Returns the carried key name of thisEncryptedKey
.java.lang.String
getRecipient()
Returns a hint as to which recipient thisEncryptedKey
is intended for.java.util.List
getReferenceList()
Returns an unmodifiable list ofReferenceType
s containing pointers to data and keys encrypted using this key.-
Methods inherited from interface javax.xml.crypto.enc.EncryptedType
encrypt, getCipherData, getCipherText, getEncoding, getEncryptionMethod, getEncryptionProperties, getId, getKeyInfo, getMimeType, getToBeEncrypted, getType
-
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
-
-
-
-
Field Detail
-
TYPE
static final java.lang.String TYPE
URI identifying the EncryptedKey KeyInfo type: http://www.w3.org/2001/04/xmlenc#EncryptedKey. This can be specified as the value of the type parameter of theRetrievalMethod
class to identify the referent's type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getReferenceList
java.util.List getReferenceList()
Returns an unmodifiable list ofReferenceType
s containing pointers to data and keys encrypted using this key.- Returns:
- an unmodifiable list of
ReferenceType
s (may be empty but nevernull
)
-
getCarriedKeyName
java.lang.String getCarriedKeyName()
Returns the carried key name of thisEncryptedKey
.- Returns:
- the carried key name or
null
if not specified
-
getRecipient
java.lang.String getRecipient()
Returns a hint as to which recipient thisEncryptedKey
is intended for.- Returns:
- the recipient or
null
if not specified
-
decrypt
java.io.InputStream decrypt(XMLDecryptContext context) throws XMLEncryptionException
Decrypts theCipherData
in thisEncryptedKey
.- Specified by:
decrypt
in interfaceEncryptedType
- Parameters:
context
- the decryption context- Returns:
- the decrypted
CipherData
as an InputStream. - Throws:
java.lang.NullPointerException
- if context isnull
XMLEncryptionException
- if an error occurs while decrypting
-
decryptKey
java.security.Key decryptKey(XMLDecryptContext context, AlgorithmMethod alg) throws XMLEncryptionException
Decrypts theCipherData
in thisEncryptedKey
and returns the decrypted key as aKey
object.- Parameters:
context
- the decryption contextalg
- the algorithm of the decrypted key- Returns:
- the decrypted
CipherData
as a key - Throws:
java.lang.NullPointerException
- if context isnull
or alg isnull
.XMLEncryptionException
- if an error occurs while decrypting
-
-