|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectau.gov.nehta.vendorlibrary.common.security.KeystoreUtil
public final class KeystoreUtil
KeystoreUtil
class to load keystore from a file, and obtain X509 certificates and private keys from
key stores.
Method Summary | |
---|---|
static java.security.cert.X509Certificate |
getSigningCertificate(java.security.KeyStore keystore,
java.lang.String certificateAlias)
Returns the X509Certificate object for the provided keystore and certificateAlias values. |
static java.security.cert.X509Certificate |
getSigningCertificate(java.lang.String keystoreType,
java.lang.String keystorePassword,
java.lang.String keystorePathname,
java.lang.String certificateAlias)
Returns the X509Certificate object for the provided keystorePathname, keystorePassword
keystoreType and certificateAlias values. |
static java.security.PrivateKey |
getSigningPrivateKey(java.security.KeyStore keystore,
java.lang.String keystorePassword,
java.lang.String privateKeyAlias)
Returns the PrivateKey object for the provided keystore, privateKeyAlias, keystorePassword values. |
static java.security.PrivateKey |
getSigningPrivateKey(java.lang.String keystoreType,
java.lang.String keystorePassword,
java.lang.String keystorePathname,
java.lang.String privateKeyAlias)
Returns the PrivateKey object for the provided keystorepathname, keystorePassword and
privateKeyAlias values. |
static javax.net.ssl.SSLSocketFactory |
getSslSocketFactory(java.lang.String privateKeyStoreType,
java.lang.String privateKeyStoreFile,
java.lang.String privateKeyStorePassword,
java.lang.String privateKeyPassword,
java.lang.String privateKeyAlias,
java.lang.String trustStoreType,
java.lang.String trustStoreFile,
java.lang.String trustStorePassword)
|
static java.security.KeyStore |
loadKeyStore(java.lang.String keystoreType,
java.lang.String keystorePassword,
java.lang.String keystorePathname)
Returns the Keystore object for the provided keystorePathname, keystorePassword, keystoreType values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.security.KeyStore loadKeyStore(java.lang.String keystoreType, java.lang.String keystorePassword, java.lang.String keystorePathname) throws java.security.GeneralSecurityException
keystoreType
- the type of keystore keystorePassword
- the password used to check the integrity of the keystore,
the password used to unlock the keystorekeystorePathname
- a pathname string
java.security.GeneralSecurityException
- if either of the keystorePassword, keystorePathname or keystoreType is invalid.public static java.security.cert.X509Certificate getSigningCertificate(java.lang.String keystoreType, java.lang.String keystorePassword, java.lang.String keystorePathname, java.lang.String certificateAlias) throws java.security.GeneralSecurityException
X509Certificate
object for the provided keystorePathname, keystorePassword
keystoreType and certificateAlias values.
keystoreType
- the type of keystore keystorePassword
- the password used to check the integrity of the keystore,
the password used to unlock the keystorekeystorePathname
- the abstract pathname stringcertificateAlias
- the alias name of the certificate
X509Certificate
from the provided private Keystore.
{@link
- java.security.GeneralSecurityException}
java.security.GeneralSecurityException
public static java.security.cert.X509Certificate getSigningCertificate(java.security.KeyStore keystore, java.lang.String certificateAlias) throws java.security.GeneralSecurityException
X509Certificate
object for the provided keystore and certificateAlias values.
keystore
- the type of keystore certificateAlias
- the alias name of the certificate
X509Certificate
java.security.GeneralSecurityException
public static java.security.PrivateKey getSigningPrivateKey(java.lang.String keystoreType, java.lang.String keystorePassword, java.lang.String keystorePathname, java.lang.String privateKeyAlias) throws java.security.GeneralSecurityException
PrivateKey
object for the provided keystorepathname, keystorePassword and
privateKeyAlias values.
keystoreType
- the type of keystore keystorePassword
- the password used to check the integrity of the keystore,
the password used to unlock the keystorekeystorePathname
- the abstract pathname stringprivateKeyAlias
- the alias name of the privateKey.
PrivateKey
java.security.GeneralSecurityException
- if keystoreType, KeystorePathname, privateKeyAlias doesnot exists or invalid.public static java.security.PrivateKey getSigningPrivateKey(java.security.KeyStore keystore, java.lang.String keystorePassword, java.lang.String privateKeyAlias) throws java.security.GeneralSecurityException
PrivateKey
object for the provided keystore, privateKeyAlias, keystorePassword values.
keystore
- keystore object of type KeyStore
keystorePassword
- the password for recovering the key from the keystoreprivateKeyAlias
- the alias name of the privateKey.
java.security.GeneralSecurityException
- if keystore, privateKeyAlias or keystorePassword deosnot exists or invalid.public static javax.net.ssl.SSLSocketFactory getSslSocketFactory(java.lang.String privateKeyStoreType, java.lang.String privateKeyStoreFile, java.lang.String privateKeyStorePassword, java.lang.String privateKeyPassword, java.lang.String privateKeyAlias, java.lang.String trustStoreType, java.lang.String trustStoreFile, java.lang.String trustStorePassword) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |