Class DigitalSignatureConfiguration

  • All Implemented Interfaces:
    Cloneable, org.apache.camel.CamelContextAware

    @UriParams
    public class DigitalSignatureConfiguration
    extends Object
    implements Cloneable, org.apache.camel.CamelContextAware
    • Constructor Detail

      • DigitalSignatureConfiguration

        public DigitalSignatureConfiguration()
    • Method Detail

      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • setCamelContext

        public void setCamelContext​(org.apache.camel.CamelContext camelContext)
        Specified by:
        setCamelContext in interface org.apache.camel.CamelContextAware
      • getName

        public String getName()
      • setName

        public void setName​(String name)
        The logical name of this operation.
      • getAlgorithm

        public String getAlgorithm()
        Gets the JCE name of the Algorithm that should be used for the signer.
      • setAlgorithm

        public void setAlgorithm​(String algorithm)
        Sets the JCE name of the Algorithm that should be used for the signer.
      • getPrivateKey

        public PrivateKey getPrivateKey()
        Get the PrivateKey that should be used to sign the exchange
      • getPrivateKey

        public PrivateKey getPrivateKey​(String alias)
        Get the PrivateKey that should be used to sign the signature in the exchange using the supplied alias.
        Parameters:
        alias - the alias used to retrieve the Certificate from the keystore.
      • getPrivateKey

        public PrivateKey getPrivateKey​(String alias,
                                        char[] password)
        Get the PrivateKey that should be used to sign the signature in the exchange using the supplied alias.
        Parameters:
        alias - the alias used to retrieve the Certificate from the keystore.
      • setPrivateKey

        public void setPrivateKey​(PrivateKey privateKey)
        Set the PrivateKey that should be used to sign the exchange
        Parameters:
        privateKey - the key with with to sign the exchange.
      • getPrivateKeyName

        public String getPrivateKeyName()
      • setPrivateKeyName

        public void setPrivateKeyName​(String privateKeyName)
        Sets the reference name for a PrivateKey that can be found in the registry.
      • setPublicKey

        public void setPublicKey​(PublicKey publicKey)
        Set the PublicKey that should be used to verify the signature in the exchange.
      • getPublicKeyName

        public String getPublicKeyName()
      • setPublicKeyName

        public void setPublicKeyName​(String publicKeyName)
        Sets the reference name for a publicKey that can be found in the registry.
      • getPublicKey

        public PublicKey getPublicKey()
        get the PublicKey that should be used to verify the signature in the exchange.
      • getCertificate

        public Certificate getCertificate​(String alias)
                                   throws Exception
        Set the Certificate that should be used to verify the signature in the exchange. If a KeyStore has been configured then this will attempt to retrieve the Certificatefrom it using hte supplied alias. If either the alias or the Keystore is invalid then the configured certificate will be returned
        Parameters:
        alias - the alias used to retrieve the Certificate from the keystore.
        Throws:
        Exception
      • getCertificate

        public Certificate getCertificate()
        Get the explicitly configured Certificate that should be used to verify the signature in the exchange.
      • setCertificate

        public void setCertificate​(Certificate certificate)
        Set the Certificate that should be used to verify the signature in the exchange based on its payload.
      • getCertificateName

        public String getCertificateName()
      • setCertificateName

        public void setCertificateName​(String certificateName)
        Sets the reference name for a PrivateKey that can be found in the registry.
      • getKeystore

        public KeyStore getKeystore()
        Gets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges. A KeyStore is typically used with an alias, either one supplied in the Route definition or dynamically via the message header "CamelSignatureKeyStoreAlias". If no alias is supplied and there is only a single entry in the Keystore, then this single entry will be used.
      • setKeystore

        public void setKeystore​(KeyStore keystore)
        Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges. A KeyStore is typically used with an alias, either one supplied in the Route definition or dynamically via the message header "CamelSignatureKeyStoreAlias". If no alias is supplied and there is only a single entry in the Keystore, then this single entry will be used.
      • getKeystoreName

        public String getKeystoreName()
      • setKeystoreName

        public void setKeystoreName​(String keystoreName)
        Sets the reference name for a Keystore that can be found in the registry.
      • getPassword

        public String getPassword()
        Gets the password used to access an aliased PrivateKey in the KeyStore.
      • setPassword

        public void setPassword​(String password)
        Sets the password used to access an aliased PrivateKey in the KeyStore.
      • getKeyStoreParameters

        public org.apache.camel.support.jsse.KeyStoreParameters getKeyStoreParameters()
      • setKeyStoreParameters

        public void setKeyStoreParameters​(org.apache.camel.support.jsse.KeyStoreParameters keyStoreParameters)
        Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges based on the given KeyStoreParameters. A KeyStore is typically used with an alias, either one supplied in the Route definition or dynamically via the message header "CamelSignatureKeyStoreAlias". If no alias is supplied and there is only a single entry in the Keystore, then this single entry will be used.
      • getSecureRandom

        public SecureRandom getSecureRandom()
        Get the SecureRandom used to initialize the Signature service
      • getSecureRandomName

        public String getSecureRandomName()
      • setSecureRandomName

        public void setSecureRandomName​(String randomName)
        Sets the reference name for a SecureRandom that can be found in the registry.
      • setSecureRandom

        public void setSecureRandom​(SecureRandom secureRandom)
        Set the SecureRandom used to initialize the Signature service
        Parameters:
        secureRandom - the random used to init the Signature service
      • getBufferSize

        public Integer getBufferSize()
        Get the size of the buffer used to read in the Exchange payload data.
      • setBufferSize

        public void setBufferSize​(Integer bufferSize)
        Set the size of the buffer used to read in the Exchange payload data.
      • getProvider

        public String getProvider()
        Get the id of the security provider that provides the configured Signature algorithm.
      • setProvider

        public void setProvider​(String provider)
        Set the id of the security provider that provides the configured Signature algorithm.
        Parameters:
        provider - the id of the security provider
      • getSignatureHeaderName

        public String getSignatureHeaderName()
        Get the name of the message header that should be used to store the base64 encoded signature. This defaults to 'CamelDigitalSignature'
      • setSignatureHeaderName

        public void setSignatureHeaderName​(String signatureHeaderName)
        Set the name of the message header that should be used to store the base64 encoded signature. This defaults to 'CamelDigitalSignature'
      • isClearHeaders

        public boolean isClearHeaders()
        Determines if the Signature specific headers be cleared after signing and verification. Defaults to true, and should only be made otherwise at your extreme peril as vital private information such as Keys and passwords may escape if unset.
        Returns:
        true if the Signature headers should be unset, false otherwise
      • setClearHeaders

        public void setClearHeaders​(boolean clearHeaders)
        Determines if the Signature specific headers be cleared after signing and verification. Defaults to true, and should only be made otherwise at your extreme peril as vital private information such as Keys and passwords may escape if unset.
      • setCryptoOperation

        public void setCryptoOperation​(String operation)
        Set the Crypto operation from that supplied after the crypto scheme in the endpoint uri e.g. crypto:sign sets sign as the operation.
        Parameters:
        operation - the operation supplied after the crypto scheme
      • setCryptoOperation

        public void setCryptoOperation​(CryptoOperation operation)
      • getCryptoOperation

        public CryptoOperation getCryptoOperation()
        Gets the Crypto operation that was supplied in the crypto scheme in the endpoint uri