Class DigitalSignatureConfiguration
java.lang.Object
org.apache.camel.component.crypto.DigitalSignatureConfiguration
- All Implemented Interfaces:
Cloneable,org.apache.camel.CamelContextAware,org.apache.camel.spi.HasCamelContext
-
Constructor Summary
Constructors -
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 andCertificatesto be used in signing and verifying exchanges.Get the size of the buffer used to read in the Exchange payload data.org.apache.camel.CamelContextGet the explicitly configuredCertificatethat 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.KeyStoreParametersgetName()Gets the password used to access an aliasedPrivateKeyin 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 configuredSignaturealgorithm.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.booleanDetermines if the Signature specific headers be cleared after signing and verification.voidsetAlgorithm(String algorithm) Sets the JCE name of the Algorithm that should be used for the signer.voidSets the alias used to query the KeyStore for keys andCertificatesto be used in signing and verifying exchanges.voidsetBufferSize(Integer bufferSize) Set the size of the buffer used to read in the Exchange payload data.voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetCertificate(Certificate certificate) Set the Certificate that should be used to verify the signature in the exchange based on its payload.voidsetCertificateName(String certificateName) Sets the reference name for a PrivateKey that can be found in the registry.voidsetClearHeaders(boolean clearHeaders) Determines if the Signature specific headers be cleared after signing and verification.voidsetCryptoOperation(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.voidsetCryptoOperation(CryptoOperation operation) voidsetKeystore(KeyStore keystore) Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges.voidsetKeystoreName(String keystoreName) Sets the reference name for a Keystore that can be found in the registry.voidsetKeyStoreParameters(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.voidThe logical name of this operation.voidsetPassword(String password) Sets the password used to access an aliasedPrivateKeyin the KeyStore.voidsetPrivateKey(PrivateKey privateKey) Set the PrivateKey that should be used to sign the exchangevoidsetPrivateKeyName(String privateKeyName) Sets the reference name for a PrivateKey that can be found in the registry.voidsetProvider(String provider) Set the id of the security provider that provides the configuredSignaturealgorithm.voidsetPublicKey(PublicKey publicKey) Set the PublicKey that should be used to verify the signature in the exchange.voidsetPublicKeyName(String publicKeyName) Sets the reference name for a publicKey that can be found in the registry.voidsetSecureRandom(SecureRandom secureRandom) Set the SecureRandom used to initialize the Signature servicevoidsetSecureRandomName(String randomName) Sets the reference name for a SecureRandom that can be found in the registry.voidsetSignatureHeaderName(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:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin 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 andCertificatesto 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 andCertificatesto 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 aKeyStorehas been configured then this will attempt to retrieve theCertificatefrom 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 configuredCertificatethat 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. AKeyStoreis 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. AKeyStoreis 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 aliasedPrivateKeyin the KeyStore. -
setPassword
Sets the password used to access an aliasedPrivateKeyin 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. AKeyStoreis 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 configuredSignaturealgorithm. -
setProvider
Set the id of the security provider that provides the configuredSignaturealgorithm.- 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
-