javax.xml.crypto.enc
Interface EncryptedType
All Superinterfaces:
All known subinterfaces:
- public interface EncryptedType
- extends XMLStructure
EncryptedType
element as defined in the
W3C Recommendation for XML-Encryption Syntax and Processing.
Its schema definition is as follows:
Field Summary
| Modifier and Type | Field and Description |
|---|---|
|
CONTENT
The encrypted element content type URI.
|
|
ELEMENT
The encrypted element type URI.
|
|
XMLNS
The XML Encryption namespace URI
|
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
decrypt(XMLDecryptContext context)
Decrypts the
CipherData in this EncryptedData.
|
|
encrypt(XMLEncryptContext context)
Encrypts the ToBeEncrypted passed to the construction of this EncryptedType and inserts it in the
CipherValue or CipherReference of the CipherData of this
EncryptedData.
|
getCipherData()
Returns the cipher data containing the encrypted data.
|
|
|
getCipherText()
Returns the encrypted data if the EncryptedType stores the encrypted data
as CipherReference.
|
|
getEncoding()
Returns a URI identifying the transfer encoding of the data that
has been encrypted.
|
getEncryptionMethod()
Returns the encryption method applied to the cipher data.
|
|
getEncryptionProperties()
Returns the encryption properties associated with this encrypted type.
|
|
|
getId()
Returns the optional
ID.
|
getKeyInfo()
Returns the key info that carries information about the key used to
encrypt the data.
|
|
|
getMimeType()
Returns the mime type of the data that has been encrypted.
|
getToBeEncrypted()
Returns the data to be encrypted if there is any
|
|
|
getType()
Returns a URI identifying the type of the plaintext form of the
encrypted content.
|
| Methods inherited from interface javax.xml.crypto.XMLStructure |
|---|
isFeatureSupported |
Field Detail
XMLNS
- static final java.lang.String XMLNS
The XML Encryption namespace URI
See Also:
CONTENT
- static final java.lang.String CONTENT
The encrypted element content type URI.
See Also:
ELEMENT
- static final java.lang.String ELEMENT
The encrypted element type URI.
See Also:
Method Detail
getEncryptionMethod
- EncryptionMethod getEncryptionMethod( )
Returns the encryption method applied to the cipher data.
Returns:
the encryption method, or
null if not specified getKeyInfo
- KeyInfo getKeyInfo()
Returns the key info that carries information about the key used to
encrypt the data.
Returns:
the key info, or
null if not specified getCipherData
- CipherData getCipherData()
Returns the cipher data containing the encrypted data.
Returns:
the cipher data, or
null if the data is a CipherValue
and the data has not been encrypted yet getEncryptionProperties
- EncryptionProperties getEncryptionProperties( )
Returns the encryption properties associated with this encrypted type.
Returns:
the encryption properties, or
null if not specified getId
- java.lang.String getId()
Returns the optional
ID.
Returns:
the
ID, or null if not specified getType
- java.lang.String getType()
Returns a URI identifying the type of the plaintext form of the
encrypted content.
Returns:
the type, or
null if not specified getMimeType
- java.lang.String getMimeType()
Returns the mime type of the data that has been encrypted.
Returns:
the mime type, or
null if not specified getEncoding
- java.lang.String getEncoding()
Returns a URI identifying the transfer encoding of the data that
has been encrypted.
Returns:
the encoding, or
null if not specified encrypt
- void encrypt(XMLEncryptContext context)
- throws XMLEncryptionException
- MarshalException
Encrypts the ToBeEncrypted passed to the construction of this EncryptedType and inserts it in the
CipherValue or CipherReference of the CipherData of this
EncryptedData.
The data is assumed to be serialized by the application before invoking this method.
Parameters:
context - the encryption context Throws:
java.lang.NullPointerException - if context is null MarshalException - if an error occurs while marshalling XMLEncryptionException - if an error occurs while encrypting decrypt
- java.io.InputStream decrypt(XMLDecryptContext context)
- throws XMLEncryptionException
Decrypts the
CipherData in this EncryptedData.
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 getCipherText
- java.io.InputStream getCipherText( )
Returns the encrypted data if the EncryptedType stores the encrypted data
as CipherReference.
Returns:
the encrypted data if EncryptedType has CipherReference as CipherData
Throws:
java.lang.IllegalStateException - if a CipherData is not a CipherReference;
or this method is called on a unmarshalled EncryptedType. getToBeEncrypted
- ToBeEncrypted getToBeEncrypted( )
Returns the data to be encrypted if there is any
Returns:
the data to be encrypted if there is any