public class MerlinKeyRegister
extends org.apache.ws.security.components.crypto.Merlin
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AuthorityKeyStoreEntry
Admin certificate alias.
|
static int |
CodeInternalError |
static int |
CodeNoRecovery |
static int |
CodeRecoverySuccessful |
protected static java.lang.String |
dataFolder
Service data folder.
|
protected static java.security.KeyStore |
keyStore
The actual keystore.
|
protected static org.apache.log4j.Logger |
logger
Logger.
|
protected static MerlinKeyRegister |
mr
The singleton instance.
|
protected static java.lang.String |
root
Service root directory.
|
static java.lang.String |
ServerKeySize
Size for the server key: 2KB.
|
protected static java.lang.String |
ServerKeyStoreDestination
Keystore location.
|
static java.lang.String |
ServerKeyStoreName
Service keystore name.
|
static java.lang.String |
ServerKeyValidity
Validity interval for the server key: approximately 10 years.
|
protected static java.lang.String |
serverPassword |
static java.lang.String |
ServiceKeyStoreEntry
Service certificat alias.
|
static java.lang.String |
ServicePropertiesFile
Properties file.
|
| Constructor and Description |
|---|
MerlinKeyRegister(java.util.Properties prop) |
MerlinKeyRegister(java.util.Properties prop,
java.lang.ClassLoader cls) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyToKeystore(java.lang.String alias,
java.security.cert.Certificate cert)
Adds a certificate to the keystore.
|
static int |
checkRecovery()
Tries recovery for a new instance of the Merlin Provider,
|
static int |
createServiceKeyStore(java.lang.String alias,
java.security.cert.Certificate cert)
Creates server.jks when registerAuthorityKey is invoked.
|
static java.security.cert.Certificate |
getAuthorityKey()
Retrieves the first certificate registered with the node
|
static MerlinKeyRegister |
getInstance()
Returns the singleton instance.
|
static java.security.cert.Certificate |
getServiceKey()
Retrieves the service key.
|
void |
removeKeyFromKeyStore(java.lang.String alias)
Removes a trusted key from the node.
|
void |
setKeyStore(java.security.KeyStore arg0)
Sets the keystore to be used by the Merlin Provider.
|
getCertificateData, getX509Certificates, validateCertPathgetAliasesForDN, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509CertThumb, getCertificateFactory, getCertificates, getDefaultX509Alias, getKeyStore, getPrivateKey, getSKIBytesFromCert, load, loadCertificatepublic static final java.lang.String AuthorityKeyStoreEntry
public static final java.lang.String ServiceKeyStoreEntry
public static final java.lang.String ServerKeyValidity
public static final java.lang.String ServerKeySize
public static final java.lang.String ServerKeyStoreName
public static final java.lang.String ServicePropertiesFile
public static final int CodeInternalError
public static final int CodeRecoverySuccessful
public static final int CodeNoRecovery
protected static final org.apache.log4j.Logger logger
protected static final java.lang.String root
protected static final java.lang.String dataFolder
protected static final java.lang.String ServerKeyStoreDestination
protected static MerlinKeyRegister mr
protected static java.security.KeyStore keyStore
protected static java.lang.String serverPassword
public MerlinKeyRegister(java.util.Properties prop)
throws java.io.IOException,
org.apache.ws.security.components.crypto.CredentialException
java.io.IOExceptionorg.apache.ws.security.components.crypto.CredentialExceptionpublic MerlinKeyRegister(java.util.Properties prop,
java.lang.ClassLoader cls)
throws java.io.IOException,
org.apache.ws.security.components.crypto.CredentialException
java.io.IOExceptionorg.apache.ws.security.components.crypto.CredentialExceptionpublic static MerlinKeyRegister getInstance()
public void setKeyStore(java.security.KeyStore arg0)
setKeyStore in class org.apache.ws.security.components.crypto.AbstractCryptoarg0 - arg0public static int checkRecovery()
public static int createServiceKeyStore(java.lang.String alias,
java.security.cert.Certificate cert)
alias - this alias should be "authoritykey", we will use "authoritykey"cert - the first trusted certificate to be addedpublic static java.security.cert.Certificate getServiceKey()
public static java.security.cert.Certificate getAuthorityKey()
public void addKeyToKeystore(java.lang.String alias,
java.security.cert.Certificate cert)
throws java.io.IOException,
java.security.KeyStoreException,
java.security.cert.CertificateException,
java.security.NoSuchAlgorithmException
alias - aliascert - certjava.io.IOException - in case of errorjava.security.KeyStoreException - in case of errorjava.security.cert.CertificateException - in case of errorjava.security.NoSuchAlgorithmException - in case of errorpublic void removeKeyFromKeyStore(java.lang.String alias)
throws java.io.IOException,
java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
alias - aliasjava.io.IOException - in case of errorjava.security.KeyStoreException - in case of errorjava.security.NoSuchAlgorithmException - in case of errorjava.security.cert.CertificateException - in case of errorCopyright © 2018 RENCI. All Rights Reserved.