public class SignatureHelper extends Object
Not thread safe
| Modifier and Type | Field and Description |
|---|---|
protected Certificate[] |
certificateChain |
static KeyStoreType |
DEFAULT_KEY_STORE_TYPE |
protected org.bouncycastle.operator.jcajce.JcaContentSignerBuilder |
jcaContentSignerBuilder |
protected org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder |
jcaDigestCalculatorProviderBuilder |
protected KeyPair |
keyPair |
protected Provider |
provider |
protected X509Certificate |
x509Certificate |
| Modifier | Constructor and Description |
|---|---|
|
SignatureHelper(File keyStoreFile,
String keyStorePassword,
KeyStoreType keyStoreType,
String keyAlias,
String keyPassword)
Loads the keystore and obtains the private key, the public key and the associated certificate referenced by the alias.
|
|
SignatureHelper(File keyStoreFile,
String keyStorePassword,
String keyPassword)
Loads the keystore and obtains the private key, the public key and the associated certificate
|
|
SignatureHelper(File keyStoreFile,
String keyStorePassword,
String keyAlias,
String keyPassword)
Loads the keystore and obtains the private key, the public key and the associated certificate referenced by the alias.
|
|
SignatureHelper(InputStream keyStoreStream,
String keyStorePassword,
KeyStoreType keyStoreType,
String keyAlias,
String keyPassword)
Loading keystore and fetching key
|
|
SignatureHelper(InputStream keyStoreStream,
String keyStorePassword,
String keyAlias,
String keyPassword)
Loading keystore and fetching key
|
|
SignatureHelper(KeyStore keyStore,
String keyAlias,
String keyPassword)
Obtains the private key, the public key and the associated certificate referenced by the alias from the given keystore
|
protected |
SignatureHelper(Provider provider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
loadCertificate(KeyStore keyStore,
String keyAlias,
String keyPassword) |
protected KeyStore |
loadKeyStore(InputStream keyStoreStream,
String keyStorePassword,
KeyStoreType keyStoreType) |
public static final KeyStoreType DEFAULT_KEY_STORE_TYPE
protected final Provider provider
protected final org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder jcaDigestCalculatorProviderBuilder
protected X509Certificate x509Certificate
protected Certificate[] certificateChain
protected KeyPair keyPair
protected org.bouncycastle.operator.jcajce.JcaContentSignerBuilder jcaContentSignerBuilder
public SignatureHelper(File keyStoreFile, String keyStorePassword, String keyPassword) throws IOException
IOExceptionpublic SignatureHelper(File keyStoreFile, String keyStorePassword, String keyAlias, String keyPassword) throws IOException
keyStoreFile - file holding the JKS keystore.keyStorePassword - password of the key store itselfkeyAlias - the alias referencing the private and public key pair.keyPassword - password protecting the private keyIOExceptionpublic SignatureHelper(InputStream keyStoreStream, String keyStorePassword, String keyAlias, String keyPassword)
keyStoreStream - Stream for keystorekeyStorePassword - Password to open keystorekeyAlias - Key alias, uses first key if set to nullkeyPassword - Key passwordpublic SignatureHelper(File keyStoreFile, String keyStorePassword, KeyStoreType keyStoreType, String keyAlias, String keyPassword) throws IOException
keyStoreFile - file holding the JKS keystore.keyStorePassword - password of the key store itselfkeyStoreType - key store typekeyAlias - the alias referencing the private and public key pair.keyPassword - password protecting the private keyIOExceptionpublic SignatureHelper(InputStream keyStoreStream, String keyStorePassword, KeyStoreType keyStoreType, String keyAlias, String keyPassword)
keyStoreStream - Stream for keystorekeyStorePassword - Password to open keystorekeyStoreType - key store typekeyAlias - Key alias, uses first key if set to nullkeyPassword - Key passwordpublic SignatureHelper(KeyStore keyStore, String keyAlias, String keyPassword)
keyStore - Loaded keystorekeyAlias - Key alias, uses first key if set to nullkeyPassword - Key passwordprotected SignatureHelper(Provider provider)
protected KeyStore loadKeyStore(InputStream keyStoreStream, String keyStorePassword, KeyStoreType keyStoreType)
Copyright © 2023. All rights reserved.