public class SignatureHelper extends Object
Not thread safe
| Modifier and Type | Field and Description |
|---|---|
protected Certificate[] |
certificateChain |
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,
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,
String keyAlias,
String keyPassword)
Loading keystore and fetching key
|
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) |
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 passwordprotected SignatureHelper(Provider provider)
Copyright © 2017 Norwegian Agency for Public Management and eGovernment (Difi). All rights reserved.