Class 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.
  • Constructor Details

    • XMLSecurityDataFormat

      public XMLSecurityDataFormat()
  • Method Details

    • 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
      The default value is XMLCipher.AES_256_GCM
    • 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
      The default value is XMLCipher.RSA_OAEP
    • 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
      The default value is XMLCipher.SHA1
    • 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
      The default value is EncryptionConstants.MGF1_SHA1
    • 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 interface org.apache.camel.spi.NamespaceAware
    • getNamespaces

      public Map<String,String> getNamespaces()
      Specified by:
      getNamespaces in interface org.apache.camel.spi.NamespaceAware