javax.xml.crypto.enc.keyinfo
Interface EncryptedKey
-
- All Superinterfaces:
- EncryptedType, XMLStructure
public interface EncryptedKey extends EncryptedType
Represents theEncryptedKeyelement. Its schema definition is as follows:
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringTYPEURI 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.InputStreamdecrypt(XMLDecryptContext context)Decrypts theCipherDatain thisEncryptedKey.java.security.KeydecryptKey(XMLDecryptContext context, AlgorithmMethod alg)Decrypts theCipherDatain thisEncryptedKeyand returns the decrypted key as aKeyobject.java.lang.StringgetCarriedKeyName()Returns the carried key name of thisEncryptedKey.java.lang.StringgetRecipient()Returns a hint as to which recipient thisEncryptedKeyis intended for.java.util.ListgetReferenceList()Returns an unmodifiable list ofReferenceTypes 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 theRetrievalMethodclass to identify the referent's type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getReferenceList
java.util.List getReferenceList()
Returns an unmodifiable list ofReferenceTypes containing pointers to data and keys encrypted using this key.- Returns:
- an unmodifiable list of
ReferenceTypes (may be empty but nevernull)
-
getCarriedKeyName
java.lang.String getCarriedKeyName()
Returns the carried key name of thisEncryptedKey.- Returns:
- the carried key name or
nullif not specified
-
getRecipient
java.lang.String getRecipient()
Returns a hint as to which recipient thisEncryptedKeyis intended for.- Returns:
- the recipient or
nullif not specified
-
decrypt
java.io.InputStream decrypt(XMLDecryptContext context) throws XMLEncryptionException
Decrypts theCipherDatain thisEncryptedKey.- Specified by:
decryptin interfaceEncryptedType- Parameters:
context- the decryption context- Returns:
- the decrypted
CipherDataas an InputStream. - Throws:
java.lang.NullPointerException- if context isnullXMLEncryptionException- if an error occurs while decrypting
-
decryptKey
java.security.Key decryptKey(XMLDecryptContext context, AlgorithmMethod alg) throws XMLEncryptionException
Decrypts theCipherDatain thisEncryptedKeyand returns the decrypted key as aKeyobject.- Parameters:
context- the decryption contextalg- the algorithm of the decrypted key- Returns:
- the decrypted
CipherDataas a key - Throws:
java.lang.NullPointerException- if context isnullor alg isnull.XMLEncryptionException- if an error occurs while decrypting
-
-