Class XMLSecurityDataFormat
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.DataFormatDefinition
-
- org.apache.camel.model.dataformat.XMLSecurityDataFormat
-
- All Implemented Interfaces:
org.apache.camel.spi.NamespaceAware
@Metadata(firstVersion="2.0.0", label="dataformat,transformation,xml", title="XML Security") public class XMLSecurityDataFormat extends DataFormatDefinition implements org.apache.camel.spi.NamespaceAware
Encrypt and decrypt XML payloads using Apache Santuario.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XMLSecurityDataFormat.Builder
Builder
is a specific builder forXMLSecurityDataFormat
.
-
Constructor Summary
Constructors Constructor Description XMLSecurityDataFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAddKeyValueForEncryptedKey()
String
getDigestAlgorithm()
String
getKeyCipherAlgorithm()
org.apache.camel.support.jsse.KeyStoreParameters
getKeyOrTrustStoreParameters()
String
getKeyOrTrustStoreParametersRef()
String
getKeyPassword()
String
getMgfAlgorithm()
Map<String,String>
getNamespaces()
String
getPassPhrase()
byte[]
getPassPhraseByte()
String
getRecipientKeyAlias()
String
getSecureTag()
String
getSecureTagContents()
String
getXmlCipherAlgorithm()
void
setAddKeyValueForEncryptedKey(String addKeyValueForEncryptedKey)
Whether to add the public key used to encrypt the session key as a KeyValue in the EncryptedKey structure or not.void
setDigestAlgorithm(String digestAlgorithm)
The digest algorithm to use with the RSA OAEP algorithm.void
setKeyCipherAlgorithm(String keyCipherAlgorithm)
The cipher algorithm to be used for encryption/decryption of the asymmetric key.void
setKeyOrTrustStoreParameters(org.apache.camel.support.jsse.KeyStoreParameters keyOrTrustStoreParameters)
Configuration options for creating and loading a KeyStore instance that represents the sender's trustStore or recipient's keyStore.void
setKeyOrTrustStoreParametersRef(String id)
Refers to a KeyStore instance to lookup in the registry, which is used for configuration options for creating and loading a KeyStore instance that represents the sender's trustStore or recipient's keyStore.void
setKeyPassword(String keyPassword)
The password to be used for retrieving the private key from the KeyStore.void
setMgfAlgorithm(String mgfAlgorithm)
The MGF Algorithm to use with the RSA OAEP algorithm.void
setNamespaces(Map<String,String> nspaces)
void
setPassPhrase(String passPhrase)
A String used as passPhrase to encrypt/decrypt content.void
setPassPhraseByte(byte[] passPhraseByte)
A byte[] used as passPhrase to encrypt/decrypt content.void
setRecipientKeyAlias(String recipientKeyAlias)
The key alias to be used when retrieving the recipient's public or private key from a KeyStore when performing asymmetric key encryption or decryption.void
setSecureTag(String secureTag)
The XPath reference to the XML Element selected for encryption/decryption.void
setSecureTagContents(String secureTagContents)
A boolean value to specify whether the XML Element is to be encrypted or the contents of the XML Element.void
setXmlCipherAlgorithm(String xmlCipherAlgorithm)
The cipher algorithm to be used for encryption/decryption of the XML message content.-
Methods inherited from class org.apache.camel.model.DataFormatDefinition
getDataFormat, getDataFormatName, getShortName, setDataFormat, setDataFormatName
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Method Detail
-
getXmlCipherAlgorithm
public String getXmlCipherAlgorithm()
-
setXmlCipherAlgorithm
public void setXmlCipherAlgorithm(String xmlCipherAlgorithm)
The cipher algorithm to be used for encryption/decryption of the XML message content. The available choices are:- XMLCipher.TRIPLEDES
- XMLCipher.AES_128
- XMLCipher.AES_128_GCM
- XMLCipher.AES_192
- XMLCipher.AES_192_GCM
- XMLCipher.AES_256
- XMLCipher.AES_256_GCM
- XMLCipher.SEED_128
- XMLCipher.CAMELLIA_128
- XMLCipher.CAMELLIA_192
- XMLCipher.CAMELLIA_256
-
getPassPhrase
public String getPassPhrase()
-
setPassPhrase
public void setPassPhrase(String passPhrase)
A String used as passPhrase to encrypt/decrypt content. The passPhrase has to be provided. The passPhrase needs to be put together in conjunction with the appropriate encryption algorithm. For example using TRIPLEDES the passPhase can be a "Only another 24 Byte key"
-
getPassPhraseByte
public byte[] getPassPhraseByte()
-
setPassPhraseByte
public void setPassPhraseByte(byte[] passPhraseByte)
A byte[] used as passPhrase to encrypt/decrypt content. The passPhrase has to be provided. The passPhrase needs to be put together in conjunction with the appropriate encryption algorithm. For example using TRIPLEDES the passPhase can be a "Only another 24 Byte key"
-
getSecureTag
public String getSecureTag()
-
setSecureTag
public void setSecureTag(String secureTag)
The XPath reference to the XML Element selected for encryption/decryption. If no tag is specified, the entire payload is encrypted/decrypted.
-
getSecureTagContents
public String getSecureTagContents()
-
setSecureTagContents
public void setSecureTagContents(String secureTagContents)
A boolean value to specify whether the XML Element is to be encrypted or the contents of the XML Element. false = Element Level. true = Element Content Level.
-
setKeyCipherAlgorithm
public void setKeyCipherAlgorithm(String keyCipherAlgorithm)
The cipher algorithm to be used for encryption/decryption of the asymmetric key. The available choices are:- XMLCipher.RSA_v1dot5
- XMLCipher.RSA_OAEP
- XMLCipher.RSA_OAEP_11
-
getKeyCipherAlgorithm
public String getKeyCipherAlgorithm()
-
setRecipientKeyAlias
public void setRecipientKeyAlias(String recipientKeyAlias)
The key alias to be used when retrieving the recipient's public or private key from a KeyStore when performing asymmetric key encryption or decryption.
-
getRecipientKeyAlias
public String getRecipientKeyAlias()
-
setKeyOrTrustStoreParametersRef
public void setKeyOrTrustStoreParametersRef(String id)
Refers to a KeyStore instance to lookup in the registry, which is used for configuration options for creating and loading a KeyStore instance that represents the sender's trustStore or recipient's keyStore.
-
getKeyOrTrustStoreParametersRef
public String getKeyOrTrustStoreParametersRef()
-
getKeyOrTrustStoreParameters
public org.apache.camel.support.jsse.KeyStoreParameters getKeyOrTrustStoreParameters()
-
setKeyOrTrustStoreParameters
public void setKeyOrTrustStoreParameters(org.apache.camel.support.jsse.KeyStoreParameters keyOrTrustStoreParameters)
Configuration options for creating and loading a KeyStore instance that represents the sender's trustStore or recipient's keyStore.
-
getKeyPassword
public String getKeyPassword()
-
setKeyPassword
public void setKeyPassword(String keyPassword)
The password to be used for retrieving the private key from the KeyStore. This key is used for asymmetric decryption.
-
getDigestAlgorithm
public String getDigestAlgorithm()
-
setDigestAlgorithm
public void setDigestAlgorithm(String digestAlgorithm)
The digest algorithm to use with the RSA OAEP algorithm. The available choices are:- XMLCipher.SHA1
- XMLCipher.SHA256
- XMLCipher.SHA512
-
getMgfAlgorithm
public String getMgfAlgorithm()
-
setMgfAlgorithm
public void setMgfAlgorithm(String mgfAlgorithm)
The MGF Algorithm to use with the RSA OAEP algorithm. The available choices are:- EncryptionConstants.MGF1_SHA1
- EncryptionConstants.MGF1_SHA256
- EncryptionConstants.MGF1_SHA512
-
getAddKeyValueForEncryptedKey
public String getAddKeyValueForEncryptedKey()
-
setAddKeyValueForEncryptedKey
public void setAddKeyValueForEncryptedKey(String addKeyValueForEncryptedKey)
Whether to add the public key used to encrypt the session key as a KeyValue in the EncryptedKey structure or not.
-
setNamespaces
public void setNamespaces(Map<String,String> nspaces)
- Specified by:
setNamespaces
in interfaceorg.apache.camel.spi.NamespaceAware
-
-