public class PKCS8KeyRetriever extends KeyRetriever
Note: StorageAuthenticators used with this class must override the StorageAuthenticator.getPassword() method.
| Constructor and Description |
|---|
PKCS8KeyRetriever(java.io.InputStream p8Stream, java.lang.String keyName)
Creates a new
PKCS8KeyRetriever instance. |
PKCS8KeyRetriever(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.lang.String keyName)
Creates a new
PKCS8KeyRetriever instance. |
| Modifier and Type | Method and Description |
|---|---|
java.security.PrivateKey |
retrievePrivateKey(KeyInfoData keyInfo)
Returns the PKCS#8 private key if this
PKCS8KeyRetriever's key name matches information in the given KeyInfoData's KeyName or X509Data elements. |
addKeyRetriever, getAuthenticator, getCertificate, getCertificate, getPrivateKey, getPrivateKey, getPublicKey, getPublicKey, getSymmetricKey, getSymmetricKey, removeKeyRetriever, retrieveCertificate, retrieveCertificate, retrievePrivateKey, retrievePublicKey, retrievePublicKey, retrieveSymmetricKey, retrieveSymmetricKey, setAuthenticator, setCertificateValidator, validateCertificate, validateCertificate, validateCertificatepublic PKCS8KeyRetriever(java.io.InputStream p8Stream,
java.lang.String keyName)
throws java.io.IOException
PKCS8KeyRetriever instance.p8Stream - An input stream containing the PKCS#8 encrypted private key.keyName - The name used to identify the private key.java.io.IOExceptionpublic PKCS8KeyRetriever(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
java.lang.String keyName)
throws java.io.IOException
PKCS8KeyRetriever instance.pkcs8 - The PKCS#8 encrypted private key.keyName - The name used to identify the private key.java.io.IOExceptionpublic java.security.PrivateKey retrievePrivateKey(KeyInfoData keyInfo) throws KeyRetrievalException
PKCS8KeyRetriever's key name matches information in the given KeyInfoData's KeyName or X509Data elements.
For a KeyName element, any value may be used.
For an X509Data element, any of the following child element types may be used:
retrievePrivateKey in class KeyRetrieverkeyInfo - A KeyInfoData to be used to locate the private key.PrivateKey, or null if none could be located.StorageAuthenticationException - If an error occurs authenticating to the key source.KeyRetrievalExceptionKeyName, X509Data