Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.xmlsec.keys.retrieval
Class PKCS8KeyRetriever

`java.lang.Object
oracle.security.xmlsec.keys.retrieval.KeyRetriever
oracle.security.xmlsec.keys.retrieval.PKCS8KeyRetriever`

public class PKCS8KeyRetriever
extends KeyRetriever

Class to retrieve private keys from a PKCS#8 encrypted key file.

Note: `StorageAuthenticator`s used with this class must override the `StorageAuthenticator.getPassword()` method.

Since:
  2.0

Constructor Summary
`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.

Method Summary
`oracle.security.crypto.core.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.

Methods inherited from class oracle.security.xmlsec.keys.retrieval.KeyRetriever
`addKeyRetriever, getAuthenticator, getCertificate, getCertificate, getPrivateKey, getPrivateKey, getPublicKey, getPublicKey, getSymmetricKey, getSymmetricKey, retrieveCertificate, retrieveCertificate, retrievePrivateKey, retrievePublicKey, retrievePublicKey, retrieveSymmetricKey, retrieveSymmetricKey, setAuthenticator`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PKCS8KeyRetriever

    public PKCS8KeyRetriever(java.io.InputStream p8Stream,
                             java.lang.String keyName)
                      throws java.io.IOException

  Creates a new `PKCS8KeyRetriever` instance.
Parameters:
  `p8Stream` - An input stream containing the PKCS#8 encrypted private key.
  `keyName` - The name used to identify the private key.

### PKCS8KeyRetriever

    public PKCS8KeyRetriever(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                             java.lang.String keyName)
                      throws java.io.IOException

  Creates a new `PKCS8KeyRetriever` instance.
Parameters:
  `pkcs8` - The PKCS#8 encrypted private key.
  `keyName` - The name used to identify the private key.

Method Detail

### retrievePrivateKey

    public oracle.security.crypto.core.PrivateKey retrievePrivateKey(KeyInfoData keyInfo)
                                                              throws KeyRetrievalException

  Returns the PKCS#8 private key if this `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:

  - X509SubjectName -- the X.500 directory name ofthe certificate's subject.
  - X509SKI -- the certificate key ID contained in a Subject Key Identifier extension.
  - X509Certificate -- an X.509 certificate whose subject key ID or subject name will be used to match this PKCS#8 private key's key name.
  Overrides:
    `retrievePrivateKey` in class `KeyRetriever`
  Parameters:
    `keyInfo` - A `KeyInfoData` to be used to locate the private key.
  Returns:
    A `PrivateKey`, or `null` if none could be located.
  Throws:
    `KeyRetrievalException`
  See Also:
    `KeyName`, `X509Data`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.