public abstract class EncryptedTypeImpl extends XencDOMStructure implements EncryptedType
EncryptedType type that supports the
DOM XML representation and processing mechanism.DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected CipherDataImpl |
cipherData_
The
CipherData. |
protected String |
encoding_
The
Encoding-attribute value. |
protected EncryptionMethodImpl |
encryptionMethod_
The
EncryptionMethod. |
protected EncryptionProperties |
encryptionProperties_
The
EncryptionProperty. |
protected String |
id_
The
Id-attribute value. |
protected KeyInfo |
keyInfo_
The
KeyInfo. |
protected KeySelectorResult |
keySelectorResult_
The result of the key selector used for encryption and decryption.
|
protected String |
mimeType_
The
MimeType-attribute value. |
protected Provider |
provider_
The
Providerassigned by the XMLEncryptionFactory. |
protected ToBeEncrypted |
tbe_
The data to be encrypted.
|
protected String |
type_
The
type-attribute value. |
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALEDCONTENT, ELEMENT, XMLNS| Modifier | Constructor and Description |
|---|---|
protected |
EncryptedTypeImpl()
Creates a new instance of this
EncryptedTypeImpl. |
protected |
EncryptedTypeImpl(Node node)
Creates a new instance of this
EncryptedTypeImpl with the
specified node. |
protected |
EncryptedTypeImpl(ToBeEncrypted toBeEncrypted,
EncryptionMethodImpl encMethod,
KeyInfo keyInfo,
EncryptionProperties properties,
String id,
CipherReferenceImpl cipherRef)
Creates a new instance of this
EncryptedTypeImpl with the
specified data to be encrypted, the encryption method, the key info, the
encryption properties, the Id-attribute value and the
CipherReference. |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
decrypt(XMLDecryptContext context)
Decrypts the
CipherData in this EncryptedData. |
protected List |
getChildStructures()
Returns the list of child structures of this
DOMStructure. |
CipherData |
getCipherData()
Returns the cipher data containing the encrypted data.
|
InputStream |
getCipherText()
Returns the encrypted data if the
EncryptedType stores the
encrypted data as CipherReference. |
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.
|
String |
getId()
Returns the optional ID.
|
KeyInfo |
getKeyInfo()
Returns the key info that carries information about the key used to encrypt
the data.
|
String |
getMimeType()
Returns the mime type of the data that has been encrypted.
|
ToBeEncrypted |
getToBeEncrypted()
Returns the data to be encrypted if there is any.
|
String |
getType()
Returns a URI identifying the type of the plaintext form of the encrypted
content.
|
protected void |
marshalAttributes(DOMCryptoContext context,
Element parent)
Marshals the XML representation of all
Attributes
represented by this DOMStrucuture. |
protected Attr |
marshalIDAttribute(DOMCryptoContext context,
Element parent)
Marshals the XML representation of an optional
Id-attribute
represented by this DOMStructure. |
protected void |
putChildStructure(DOMStructure childStructure)
Put an unmarshalled child structure.
|
protected Key |
selectKey(XMLCryptoContext context,
boolean encrypt)
Selects a key for encryption or decryption.
|
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshal the given
attributes. |
getNamespace, initaddBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getLocalName, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshal, marshalElement, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalElement, unmarshalIDAttribute, unmarshalStructures, wrapNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitencryptisFeatureSupportedprotected Provider provider_
protected EncryptionMethodImpl encryptionMethod_
EncryptionMethod.protected KeyInfo keyInfo_
KeyInfo.protected CipherDataImpl cipherData_
CipherData. (must not be null)protected EncryptionProperties encryptionProperties_
EncryptionProperty.protected String id_
Id-attribute value.protected String type_
type-attribute value.protected String mimeType_
MimeType-attribute value.protected String encoding_
Encoding-attribute value.protected KeySelectorResult keySelectorResult_
protected ToBeEncrypted tbe_
protected EncryptedTypeImpl()
EncryptedTypeImpl.protected EncryptedTypeImpl(Node node) throws MarshalException
EncryptedTypeImpl with the
specified node.node - the nodeNullPointerException - if node is nullMarshalException - if an exception occurs during unmarshalingprotected EncryptedTypeImpl(ToBeEncrypted toBeEncrypted, EncryptionMethodImpl encMethod, KeyInfo keyInfo, EncryptionProperties properties, String id, CipherReferenceImpl cipherRef)
EncryptedTypeImpl with the
specified data to be encrypted, the encryption method, the key info, the
encryption properties, the Id-attribute value and the
CipherReference.toBeEncrypted - the data to be encryptedencMethod - the encryption method (may be null)keyInfo - the key info (may be null)properties - the encryption properties (may be null or empty)id - the Id-attribute value (may be null)cipherRef - the CipherReferenceNullPointerException - if toBeEncrypted or cipherRef is
nullIllegalArgumentException - if ToBeEncryptedKey is passed in as toBeEncryptedpublic CipherData getCipherData()
javax.xml.crypto.enc.EncryptedTypegetCipherData in interface EncryptedTypenull if the data has not been
encrypted yet.EncryptedType.getCipherData()public InputStream getCipherText() throws IllegalStateException
javax.xml.crypto.enc.EncryptedTypeEncryptedType stores the
encrypted data as CipherReference.getCipherText in interface EncryptedTypeEncryptedType has
CipherReference as CipherData.IllegalStateException - if a CipherData is not a CipherReference;
or this method is called on an unmarshalled
EncryptedType.EncryptedType.getCipherText()public String getEncoding()
javax.xml.crypto.enc.EncryptedTypegetEncoding in interface EncryptedTypenull if not specified.EncryptedType.getEncoding()public EncryptionMethod getEncryptionMethod()
javax.xml.crypto.enc.EncryptedTypegetEncryptionMethod in interface EncryptedTypenull if not specified.EncryptedType.getEncryptionMethod()public EncryptionProperties getEncryptionProperties()
javax.xml.crypto.enc.EncryptedTypegetEncryptionProperties in interface EncryptedTypenull if not specified.EncryptedType.getEncryptionProperties()public String getId()
javax.xml.crypto.enc.EncryptedTypegetId in interface EncryptedTypenull if not specified.EncryptedType.getId()public KeyInfo getKeyInfo()
javax.xml.crypto.enc.EncryptedTypegetKeyInfo in interface EncryptedTypenull if not specifiedEncryptedType.getKeyInfo()public String getMimeType()
javax.xml.crypto.enc.EncryptedTypegetMimeType in interface EncryptedTypenull if not specified.EncryptedType.getMimeType()public ToBeEncrypted getToBeEncrypted()
javax.xml.crypto.enc.EncryptedTypegetToBeEncrypted in interface EncryptedTypeEncryptedType.getToBeEncrypted()public String getType()
javax.xml.crypto.enc.EncryptedTypegetType in interface EncryptedTypenull if not specified.EncryptedType.getType()protected List getChildStructures()
DOMStructureDOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method to return a list of
DOMStrucutres represented by this subclass.
getChildStructures in class DOMStructureDOMStructures (may be empty, but never
null)DOMStructure.getChildStructures()protected void marshalAttributes(DOMCryptoContext context, Element parent) throws MarshalException
DOMStructureAttributes
represented by this DOMStrucuture.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
If no namespace prefix is set in the context for the namespace
of the Element represented by this DOMStructure an
namespace declaration is marshaled and returned. Otherwise, an empty list
is returned.
A subclass has to overwrite this method in order to marshal any additional attributes.
marshalAttributes in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.MarshalException - if an exception occurs during marshalingDOMStructure.marshalAttributes(DOMCryptoContext,
Element)protected Attr marshalIDAttribute(DOMCryptoContext context, Element parent)
DOMStructureId-attribute
represented by this DOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method in order to marshal an
Id-attribute.
marshalIDAttribute in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.Id-attribute if any, otherwise
nullDOMStructure.marshalIDAttribute(DOMCryptoContext,
Element)protected void putChildStructure(DOMStructure childStructure) throws MarshalException
DOMStructure
This method is called by
DOMStructure.unmarshalStructures(NodeList, DOMCryptoContext) for every
unmarshalled child structure.
A subclass has to overwrite this method to store the given child structure in its the corresponding field.
putChildStructure in class DOMStructurechildStructure - the unmarshalled child structureMarshalExceptionDOMStructure.putChildStructure(iaik.xml.crypto.dom.DOMStructure)protected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
DOMStructureattributes.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
A subclass has to overwrite this method to perform any special unmarshaling required.
unmarshalAttributes in class DOMStructureattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingDOMStructure.unmarshalAttributes(org.w3c.dom.NamedNodeMap,
DOMCryptoContext)public InputStream decrypt(XMLDecryptContext context) throws XMLEncryptionException
javax.xml.crypto.enc.EncryptedTypeCipherData in this EncryptedData.decrypt in interface EncryptedTypecontext - The decryption context.CipherData as an InputStream.XMLEncryptionException - if an error occurs while decrypting.EncryptedType.decrypt(javax.xml.crypto.enc.XMLDecryptContext)protected Key selectKey(XMLCryptoContext context, boolean encrypt) throws XMLEncryptionException
context - the contextencrypt - true for encryption, false for decryptionnull)XMLEncryptionException - if an unexpected exception occurs selecting the key© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC