Interface SignatureProviderSPI
-
- All Known Implementing Classes:
FSSignatureProvider
public interface SignatureProviderSPIThis is an interface to be implemented to sign and verify signature.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KeyProvidergetKeyProvider()Returns the key provider.voidinitialize(KeyProvider keyProvider)Initializes the key provider.byte[]signBuffer(String data, String certAlias)Signs a string using enveloped signatures and default signature algorithm.byte[]signBuffer(String data, String certAlias, String algorithm)Signs a string using enveloped signatures.booleanverifySignature(String data, byte[] signature, String algorithm, X509Certificate cert)Verifies the signature of a signed string.
-
-
-
Method Detail
-
initialize
void initialize(KeyProvider keyProvider)
Initializes the key provider.- Parameters:
keyProvider- KeyProvider object
-
signBuffer
byte[] signBuffer(String data, String certAlias) throws FSSignatureException
Signs a string using enveloped signatures and default signature algorithm.- Parameters:
data- string that needs to be signedcertAlias- Signer's certificate alias name- Returns:
- byte array which contains signature Element object
- Throws:
FSSignatureException- if an error occurred during the signing process
-
signBuffer
byte[] signBuffer(String data, String certAlias, String algorithm) throws FSSignatureException
Signs a string using enveloped signatures.- Parameters:
data- string that needs to be signedcertAlias- Signer's certificate alias namealgorithm- signing algorithm- Returns:
- byte array which contains signature Element object
- Throws:
FSSignatureException- if an error occurred during the signing process
-
verifySignature
boolean verifySignature(String data, byte[] signature, String algorithm, X509Certificate cert) throws FSSignatureException
Verifies the signature of a signed string.- Parameters:
data- string whose signature to be verifiedsignature- signature in byte arrayalgorithm- signing algorithmcert- certificate for Signer's certificate.- Returns:
trueif the xml signature is verified;falseotherwise- Throws:
FSSignatureException- if problem occurs during verification
-
getKeyProvider
KeyProvider getKeyProvider()
Returns the key provider.- Returns:
KeyProviderinstance
-
-