public final class CredentialHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
private static Logger |
LOG
Class logger.
|
| Modifier | Constructor and Description |
|---|---|
private |
CredentialHelper()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected static org.opensaml.security.x509.BasicX509Credential |
getCredentialFromKeystore(KeyStore keystore,
String keyAlias,
String keyPassword)
Gets a credential from the given store.
|
protected static org.opensaml.security.x509.BasicX509Credential |
getFileBasedCredentials(String keyFile,
String keyPassword,
String certificateFile)
Reads in the X509 credentials from the filesystem.
|
protected static org.opensaml.security.x509.BasicX509Credential |
getKeystoreCredential(String keystorePath,
String keystorePassword,
String keystoreProvider,
String keystoreType,
String keyAlias,
String keyPassword)
Reads in the X509 credentials from a keystore.
|
protected static org.opensaml.security.x509.BasicX509Credential |
getPKCS11Credential(String keystoreProvider,
String pkcs11Config,
String keyAlias,
String keyPassword)
Reads in the X509 credentials from a PKCS11 source.
|
private static final Logger LOG
protected static org.opensaml.security.x509.BasicX509Credential getFileBasedCredentials(String keyFile, String keyPassword, String certificateFile) throws KeyException, CertificateException
keyFile - path to the private key filekeyPassword - password for the private key, may be nullcertificateFile - path to the certificate file associated with the private keyCertificateException - if there is a problem decoding the certificateKeyException - if there is a problem decoding the private keyprotected static org.opensaml.security.x509.BasicX509Credential getKeystoreCredential(String keystorePath, String keystorePassword, String keystoreProvider, String keystoreType, String keyAlias, String keyPassword) throws IOException, GeneralSecurityException
keystorePath - path the keystore filekeystorePassword - keystore passwordkeystoreProvider - keystore providr identifierkeystoreType - keystore typekeyAlias - private key aliaskeyPassword - private key password, may not be nullIOException - if there was a problem reading the keystoreGeneralSecurityException - if there was a problemprotected static org.opensaml.security.x509.BasicX509Credential getPKCS11Credential(String keystoreProvider, String pkcs11Config, String keyAlias, String keyPassword) throws IOException, GeneralSecurityException
keystoreProvider - keystore provider classpkcs11Config - PKCS11 configuration file used by the keystore providerkeyAlias - private key keystore aliaskeyPassword - private key password, may not be nullIOException - if it is not possible to read the keystoreGeneralSecurityException - if there is a problem loading the keystore, or loading the credential from itprotected static org.opensaml.security.x509.BasicX509Credential getCredentialFromKeystore(KeyStore keystore, String keyAlias, String keyPassword) throws GeneralSecurityException
keystore - keystore from which to extract the credentialskeyAlias - keystore key aliaskeyPassword - private key passwordGeneralSecurityException - if there is a problem getting the credential from the keystore,
or if the credential is not of a known typeCopyright © 2011–2016. All rights reserved.