Package net.jsign.jca
Interface SigningService
-
- All Known Implementing Classes:
AzureKeyVaultSigningService,DigiCertOneSigningService,ESignerSigningService,GoogleCloudSigningService
public interface SigningService
Interface to a signing service.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>aliases()Returns the certificate aliases available.Certificate[]getCertificateChain(String alias)Returns the certificate chain for the alias specified.StringgetName()Returns the name of the service.SigningServicePrivateKeygetPrivateKey(String alias, char[] password)Returns the private key for the certificate alias specified.byte[]sign(SigningServicePrivateKey privateKey, String algorithm, byte[] data)Sign the data with the private key specified.
-
-
-
Method Detail
-
aliases
List<String> aliases() throws KeyStoreException
Returns the certificate aliases available.- Throws:
KeyStoreException
-
getCertificateChain
Certificate[] getCertificateChain(String alias) throws KeyStoreException
Returns the certificate chain for the alias specified.- Parameters:
alias- the name of the certificate- Throws:
KeyStoreException
-
getPrivateKey
SigningServicePrivateKey getPrivateKey(String alias, char[] password) throws UnrecoverableKeyException
Returns the private key for the certificate alias specified.- Parameters:
alias- the name of the certificatepassword- the secret required to access the key- Throws:
UnrecoverableKeyException
-
sign
byte[] sign(SigningServicePrivateKey privateKey, String algorithm, byte[] data) throws GeneralSecurityException
Sign the data with the private key specified.- Parameters:
privateKey- the private keyalgorithm- the signing algorithm (for example SHA256withRSA)data- the data to be signed- Throws:
GeneralSecurityException
-
-