|
XML Security, 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xml.enc.dom.DOMStructure
com.ibm.xml.enc.dom.DOMEncryptedKey
public final class DOMEncryptedKey
Field Summary |
---|
Fields inherited from interface javax.xml.crypto.enc.keyinfo.EncryptedKey |
---|
TYPE |
Fields inherited from interface javax.xml.crypto.enc.EncryptedType |
---|
CONTENT, ELEMENT, XMLNS |
Constructor Summary | |
---|---|
DOMEncryptedKey(org.w3c.dom.Element encDataElem,
XMLCryptoContext context)
Creates a DOMEncryptedKey from XML. |
|
DOMEncryptedKey(java.lang.String id,
java.lang.String type,
java.lang.String mimeType,
java.lang.String encoding,
java.lang.String recipient,
DOMEncryptionMethod em,
DOMKeyInfo ki,
DOMCipherData cdata,
DOMEncryptionProperties eps,
DOMReferenceList rl,
java.lang.String carriedKeyName,
org.w3c.dom.Element localEncDataElem)
|
|
DOMEncryptedKey(ToBeEncryptedKey toBeEncrypted,
DOMEncryptionMethod em,
DOMKeyInfo ki,
DOMEncryptionProperties eps,
java.util.List references,
java.lang.String id,
java.lang.String carriedKeyName,
java.lang.String recipient)
Creates a DOMEncryptedKey from the specified components. |
|
DOMEncryptedKey(ToBeEncryptedKey toBeEncrypted,
DOMEncryptionMethod em,
DOMKeyInfo ki,
DOMEncryptionProperties eps,
java.util.List references,
java.lang.String id,
java.lang.String carriedKeyName,
java.lang.String recipient,
DOMCipherReference cipherReference)
Creates a DOMEncryptedKey from the specified components. |
Method Summary | |
---|---|
java.io.InputStream |
decrypt(XMLDecryptContext decryptContext)
Decrypts the CipherData in this EncryptedKey . |
java.security.Key |
decryptKey(XMLDecryptContext decryptContext,
AlgorithmMethod algo)
Decrypts the CipherData in this EncryptedKey
and returns the decrypted key as a Key object. |
void |
encrypt(XMLEncryptContext encryptContext)
Encrypts the ToBeEncrypted passed to the construction of this EncryptedType and inserts it in the CipherValue or CipherReference of the CipherData of this
EncryptedData . |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getCarriedKeyName()
Returns the carried key name of this EncryptedKey . |
CipherData |
getCipherData()
Returns the cipher data containing the encrypted data. |
java.io.InputStream |
getCipherText()
Returns the encrypted data if the EncryptedType stores the encrypted data as CipherReference. |
java.lang.String |
getEncoding()
Returns a URI identifying the transfer encoding of the data that has been encrypted. |
EncryptionMethod |
getEncryptionMethod()
Returns the encryption method applied to the cipher data. |
EncryptionProperties |
getEncryptionProperties()
Returns the encryption properties associated with this encrypted type. |
java.lang.String |
getId()
Returns the optional ID . |
KeyInfo |
getKeyInfo()
Returns the key info that carries information about the key used to encrypt the data. |
java.lang.String |
getMimeType()
Returns the mime type of the data that has been encrypted. |
java.lang.String |
getRecipient()
Returns a hint as to which recipient this EncryptedKey is
intended for. |
java.util.List |
getReferenceList()
Returns an unmodifiable list of ReferenceType s containing
pointers to data and keys encrypted using this key. |
ToBeEncrypted |
getToBeEncrypted()
Returns the data to be encrypted if there is any |
java.lang.String |
getType()
Returns a URI identifying the type of the plaintext form of the encrypted content. |
void |
marshal(org.w3c.dom.Node parent,
org.w3c.dom.Node nextSibling,
java.lang.String encPrefix,
DOMCryptoContext context)
|
void |
marshal(org.w3c.dom.Node parent,
java.lang.String encPrefix,
DOMCryptoContext context)
|
Methods inherited from class com.ibm.xml.enc.dom.DOMStructure |
---|
isFeatureSupported |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.crypto.XMLStructure |
---|
isFeatureSupported |
Constructor Detail |
---|
public DOMEncryptedKey(ToBeEncryptedKey toBeEncrypted, DOMEncryptionMethod em, DOMKeyInfo ki, DOMEncryptionProperties eps, java.util.List references, java.lang.String id, java.lang.String carriedKeyName, java.lang.String recipient)
DOMEncryptedKey
from the specified components.
toBeEncrypted
- the Key to be encryptedem
- the EncryptionMethod
ki
- the KeyInfo
, or null
if not specifiedeps
- the EncryptionProperties
or null
if not specified.references
- List
of ReferenceType
s point to
data and keys encrypted using this keycarriedKeyName
- an element for associating a user readable name with
the key value (specify null
to omit)recipient
- an attribute that contains a hint as to which recipient
this encrypted key value is intended for (specify null
to omit)public DOMEncryptedKey(ToBeEncryptedKey toBeEncrypted, DOMEncryptionMethod em, DOMKeyInfo ki, DOMEncryptionProperties eps, java.util.List references, java.lang.String id, java.lang.String carriedKeyName, java.lang.String recipient, DOMCipherReference cipherReference)
DOMEncryptedKey
from the specified components.
toBeEncrypted
- the Key to be encryptedem
- the EncryptionMethod
ki
- the KeyInfo
, or null
if not specifiedeps
- the EncryptionProperties
or null
if not specified.references
- List
of ReferenceType
s point to
data and keys encrypted using this keycarriedKeyName
- an element for associating a user readable name with
the key value (specify null
to omit)recipient
- an attribute that contains a hint as to which recipient
this encrypted key value is intended for (specify null
to omit)cipherReference
- a cipherReferencepublic DOMEncryptedKey(org.w3c.dom.Element encDataElem, XMLCryptoContext context) throws MarshalException
DOMEncryptedKey
from XML.
encDataElem
- EncryptedKey element
MarshalException
- if EncryptedKey cannot be unmarshalledDOMEncryptedKey(java.lang.String id, java.lang.String type, java.lang.String mimeType, java.lang.String encoding, java.lang.String recipient, DOMEncryptionMethod em, DOMKeyInfo ki, DOMCipherData cdata, DOMEncryptionProperties eps, DOMReferenceList rl, java.lang.String carriedKeyName, org.w3c.dom.Element localEncDataElem)
Method Detail |
---|
public java.util.List getReferenceList()
EncryptedKey
ReferenceType
s containing
pointers to data and keys encrypted using this key.
getReferenceList
in interface EncryptedKey
ReferenceType
s (may be
empty but never null
)public java.lang.String getCarriedKeyName()
EncryptedKey
EncryptedKey
.
getCarriedKeyName
in interface EncryptedKey
null
if not specifiedpublic java.lang.String getRecipient()
EncryptedKey
EncryptedKey
is
intended for.
getRecipient
in interface EncryptedKey
null
if not specifiedpublic java.lang.String getId()
EncryptedType
ID
.
getId
in interface EncryptedType
ID
, or null
if not specifiedpublic java.lang.String getType()
EncryptedType
getType
in interface EncryptedType
null
if not specifiedpublic java.lang.String getMimeType()
EncryptedType
getMimeType
in interface EncryptedType
null
if not specifiedpublic java.lang.String getEncoding()
EncryptedType
getEncoding
in interface EncryptedType
null
if not specifiedpublic EncryptionMethod getEncryptionMethod()
EncryptedType
getEncryptionMethod
in interface EncryptedType
null
if not specifiedpublic KeyInfo getKeyInfo()
EncryptedType
getKeyInfo
in interface EncryptedType
null
if not specifiedpublic CipherData getCipherData()
EncryptedType
getCipherData
in interface EncryptedType
null
if the data is a CipherValue
and the data has not been encrypted yetpublic EncryptionProperties getEncryptionProperties()
EncryptedType
getEncryptionProperties
in interface EncryptedType
null
if not specifiedpublic java.io.InputStream getCipherText()
EncryptedType
getCipherText
in interface EncryptedType
public ToBeEncrypted getToBeEncrypted()
EncryptedType
getToBeEncrypted
in interface EncryptedType
public void marshal(org.w3c.dom.Node parent, java.lang.String encPrefix, DOMCryptoContext context) throws MarshalException
marshal
in class DOMStructure
MarshalException
public void marshal(org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling, java.lang.String encPrefix, DOMCryptoContext context) throws MarshalException
MarshalException
public java.io.InputStream decrypt(XMLDecryptContext decryptContext) throws XMLEncryptionException
EncryptedKey
CipherData
in this EncryptedKey
.
decrypt
in interface EncryptedType
decrypt
in interface EncryptedKey
decryptContext
- the decryption context
CipherData
as an InputStream.
XMLEncryptionException
- if an error occurs while decryptingpublic java.security.Key decryptKey(XMLDecryptContext decryptContext, AlgorithmMethod algo) throws XMLEncryptionException
EncryptedKey
CipherData
in this EncryptedKey
and returns the decrypted key as a Key
object.
decryptKey
in interface EncryptedKey
decryptContext
- the decryption contextalgo
- the algorithm of the decrypted key
CipherData
as a key
XMLEncryptionException
- if an error occurs while decryptingpublic void encrypt(XMLEncryptContext encryptContext) throws MarshalException, XMLEncryptionException
EncryptedType
CipherValue
or CipherReference
of the CipherData
of this
EncryptedData
.
The data is assumed to be serialized by the application before invoking this method.
encrypt
in interface EncryptedType
encryptContext
- the encryption context
MarshalException
- if an error occurs while marshalling
XMLEncryptionException
- if an error occurs while encryptingpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
XML Security, 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |