public class GoogleCloudSigningService extends Object implements SigningService
The key alias can take one of the following forms:
| Constructor and Description |
|---|
GoogleCloudSigningService(String keyring,
String token,
Function<String,Certificate[]> certificateStore)
Creates a new Google Cloud signing service.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
aliases()
Returns the certificate aliases available.
|
Certificate[] |
getCertificateChain(String alias)
Returns the certificate chain for the alias specified.
|
String |
getName()
Returns the name of the service.
|
SigningServicePrivateKey |
getPrivateKey(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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPrivateKeypublic GoogleCloudSigningService(String keyring, String token, Function<String,Certificate[]> certificateStore)
keyring - the path of the keyring (for example projects/first-rain-123/locations/global/keyRings/mykeyring)token - the Google Cloud API access tokencertificateStore - provides the certificate chain for the keyspublic List<String> aliases() throws KeyStoreException
SigningServicealiases in interface SigningServiceKeyStoreExceptionpublic Certificate[] getCertificateChain(String alias)
SigningServicegetCertificateChain in interface SigningServicealias - the name of the certificatepublic String getName()
SigningServicegetName in interface SigningServicepublic SigningServicePrivateKey getPrivateKey(String alias, char[] password) throws UnrecoverableKeyException
SigningServicegetPrivateKey in interface SigningServicealias - the name of the certificatepassword - the secret required to access the keyUnrecoverableKeyExceptionpublic byte[] sign(SigningServicePrivateKey privateKey, String algorithm, byte[] data) throws GeneralSecurityException
SigningServicesign in interface SigningServiceprivateKey - the private keyalgorithm - the signing algorithm (for example SHA256withRSA)data - the data to be signedGeneralSecurityExceptionCopyright © 2012–2025. All rights reserved.