Class DigitalSignatureConfiguration
java.lang.Object
org.apache.camel.component.crypto.DigitalSignatureConfiguration
- All Implemented Interfaces:
Cloneable
,org.apache.camel.CamelContextAware
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Gets the JCE name of the Algorithm that should be used for the signer.getAlias()
Gets the alias used to query the KeyStore for keys andCertificates
to be used in signing and verifying exchanges.Get the size of the buffer used to read in the Exchange payload data.org.apache.camel.CamelContext
Get the explicitly configuredCertificate
that should be used to verify the signature in the exchange.getCertificate
(String alias) Set the Certificate that should be used to verify the signature in the exchange.Gets the Crypto operation that was supplied in the crypto scheme in the endpoint uriGets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges.org.apache.camel.support.jsse.KeyStoreParameters
getName()
Gets the password used to access an aliasedPrivateKey
in the KeyStore.Get the PrivateKey that should be used to sign the exchangegetPrivateKey
(String alias) Get the PrivateKey that should be used to sign the signature in the exchange using the supplied alias.getPrivateKey
(String alias, char[] password) Get the PrivateKey that should be used to sign the signature in the exchange using the supplied alias.Get the id of the security provider that provides the configuredSignature
algorithm.get the PublicKey that should be used to verify the signature in the exchange.Get the SecureRandom used to initialize the Signature serviceGet the name of the message header that should be used to store the base64 encoded signature.boolean
Determines if the Signature specific headers be cleared after signing and verification.void
setAlgorithm
(String algorithm) Sets the JCE name of the Algorithm that should be used for the signer.void
Sets the alias used to query the KeyStore for keys andCertificates
to be used in signing and verifying exchanges.void
setBufferSize
(Integer bufferSize) Set the size of the buffer used to read in the Exchange payload data.void
setCamelContext
(org.apache.camel.CamelContext camelContext) void
setCertificate
(Certificate certificate) Set the Certificate that should be used to verify the signature in the exchange based on its payload.void
setCertificateName
(String certificateName) Sets the reference name for a PrivateKey that can be found in the registry.void
setClearHeaders
(boolean clearHeaders) Determines if the Signature specific headers be cleared after signing and verification.void
setCryptoOperation
(String operation) Set the Crypto operation from that supplied after the crypto scheme in the endpoint uri e.g.void
setCryptoOperation
(CryptoOperation operation) void
setKeystore
(KeyStore keystore) Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges.void
setKeystoreName
(String keystoreName) Sets the reference name for a Keystore that can be found in the registry.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.void
The logical name of this operation.void
setPassword
(String password) Sets the password used to access an aliasedPrivateKey
in the KeyStore.void
setPrivateKey
(PrivateKey privateKey) Set the PrivateKey that should be used to sign the exchangevoid
setPrivateKeyName
(String privateKeyName) Sets the reference name for a PrivateKey that can be found in the registry.void
setProvider
(String provider) Set the id of the security provider that provides the configuredSignature
algorithm.void
setPublicKey
(PublicKey publicKey) Set the PublicKey that should be used to verify the signature in the exchange.void
setPublicKeyName
(String publicKeyName) Sets the reference name for a publicKey that can be found in the registry.void
setSecureRandom
(SecureRandom secureRandom) Set the SecureRandom used to initialize the Signature servicevoid
setSecureRandomName
(String randomName) Sets the reference name for a SecureRandom that can be found in the registry.void
setSignatureHeaderName
(String signatureHeaderName) Set the name of the message header that should be used to store the base64 encoded signature.
-
Constructor Details
-
DigitalSignatureConfiguration
public DigitalSignatureConfiguration()
-
-
Method Details
-
copy
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
getName
-
setName
The logical name of this operation. -
getAlgorithm
Gets the JCE name of the Algorithm that should be used for the signer. -
setAlgorithm
Sets the JCE name of the Algorithm that should be used for the signer. -
getAlias
Gets the alias used to query the KeyStore for keys andCertificates
to be used in signing and verifying exchanges. This value can be provided at runtime via the message headerDigitalSignatureConstants.KEYSTORE_ALIAS
-
setAlias
Sets the alias used to query the KeyStore for keys andCertificates
to be used in signing and verifying exchanges. This value can be provided at runtime via the message headerDigitalSignatureConstants.KEYSTORE_ALIAS
-
getPrivateKey
Get the PrivateKey that should be used to sign the exchange -
getPrivateKey
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
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
Set the PrivateKey that should be used to sign the exchange- Parameters:
privateKey
- the key with with to sign the exchange.
-
getPrivateKeyName
-
setPrivateKeyName
Sets the reference name for a PrivateKey that can be found in the registry. -
setPublicKey
Set the PublicKey that should be used to verify the signature in the exchange. -
getPublicKeyName
-
setPublicKeyName
Sets the reference name for a publicKey that can be found in the registry. -
getPublicKey
get the PublicKey that should be used to verify the signature in the exchange. -
getCertificate
Set the Certificate that should be used to verify the signature in the exchange. If aKeyStore
has been configured then this will attempt to retrieve theCertificate
from 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
Get the explicitly configuredCertificate
that should be used to verify the signature in the exchange. -
setCertificate
Set the Certificate that should be used to verify the signature in the exchange based on its payload. -
getCertificateName
-
setCertificateName
Sets the reference name for a PrivateKey that can be found in the registry. -
getKeystore
Gets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges. AKeyStore
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
Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges. AKeyStore
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
-
setKeystoreName
Sets the reference name for a Keystore that can be found in the registry. -
getPassword
Gets the password used to access an aliasedPrivateKey
in the KeyStore. -
setPassword
Sets the password used to access an aliasedPrivateKey
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. AKeyStore
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
Get the SecureRandom used to initialize the Signature service -
getSecureRandomName
-
setSecureRandomName
Sets the reference name for a SecureRandom that can be found in the registry. -
setSecureRandom
Set the SecureRandom used to initialize the Signature service- Parameters:
secureRandom
- the random used to init the Signature service
-
getBufferSize
Get the size of the buffer used to read in the Exchange payload data. -
setBufferSize
Set the size of the buffer used to read in the Exchange payload data. -
getProvider
Get the id of the security provider that provides the configuredSignature
algorithm. -
setProvider
Set the id of the security provider that provides the configuredSignature
algorithm.- Parameters:
provider
- the id of the security provider
-
getSignatureHeaderName
Get the name of the message header that should be used to store the base64 encoded signature. This defaults to 'CamelDigitalSignature' -
setSignatureHeaderName
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
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
-
getCryptoOperation
Gets the Crypto operation that was supplied in the crypto scheme in the endpoint uri
-