javax.xml.crypto.enc.keyinfo

Interface EncryptedKey

All Superinterfaces:
EncryptedType, XMLStructure

  1. public interface EncryptedKey
  2. extends EncryptedType
Represents the EncryptedKey element. Its schema definition is as follows: <element name="'EncryptedKey'type='xenc:EncryptedKeyType'/"> <complextype name="'EncryptedKeyType'"> <complexcontent> <extension base="'xenc:EncryptedType'"> <sequence> <element ref="'xenc:ReferenceList'minOccurs='0'/"> <element name="'CarriedKeyName'type='string'minOccurs='0'/"> </sequence> <attribute name="'Recipient'type='string'use='optional'/"> </extension> </complexcontent> </complextype>

Field Summary

Modifier and Type Field and Description
  1. static
  2. 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

Modifier and Type Method and Description
  1. java.io.InputStream
decrypt(XMLDecryptContext context)
Decrypts the CipherData in this EncryptedKey.
  1. java.security.Key
decryptKey(XMLDecryptContext context,AlgorithmMethod alg)
Decrypts the CipherData in this EncryptedKey and returns the decrypted key as a Key object.
  1. java.lang.String
getCarriedKeyName()
Returns the carried key name of this EncryptedKey.
  1. java.lang.String
getRecipient()
Returns a hint as to which recipient this EncryptedKey is intended for.
  1. java.util.List
getReferenceList()
Returns an unmodifiable list of ReferenceTypes 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

  1. 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 the RetrievalMethod class to identify the referent's type.
See Also:

Method Detail

getReferenceList

  1. java.util.List getReferenceList( )
Returns an unmodifiable list of ReferenceTypes containing pointers to data and keys encrypted using this key.
Returns:
an unmodifiable list of ReferenceTypes (may be empty but never null)

getCarriedKeyName

  1. java.lang.String getCarriedKeyName( )
Returns the carried key name of this EncryptedKey.
Returns:
the carried key name or null if not specified

getRecipient

  1. java.lang.String getRecipient()
Returns a hint as to which recipient this EncryptedKey is intended for.
Returns:
the recipient or null if not specified

decrypt

  1. java.io.InputStream decrypt(XMLDecryptContext context)
  2. throws XMLEncryptionException
Decrypts the CipherData in this EncryptedKey.
Specified by:
decrypt in interface EncryptedType
Parameters:
context - the decryption context
Returns:
the decrypted CipherData as an InputStream.
Throws:
java.lang.NullPointerException - if context is null
XMLEncryptionException - if an error occurs while decrypting

decryptKey

  1. java.security.Key decryptKey(XMLDecryptContext context,
  2. AlgorithmMethod alg)
  3. throws XMLEncryptionException
Decrypts the CipherData in this EncryptedKey and returns the decrypted key as a Key object.
Parameters:
context - the decryption context
alg - the algorithm of the decrypted key
Returns:
the decrypted CipherData as a key
Throws:
java.lang.NullPointerException - if context is null or alg is null.
XMLEncryptionException - if an error occurs while decrypting