public class

PrivateKeyFactory

extends Object
java.lang.Object
   ↳ org.bouncycastle.crypto.util.PrivateKeyFactory

Class Overview

Factory for creating private key objects from PKCS8 PrivateKeyInfo objects.

Summary

Public Constructors
PrivateKeyFactory()
Public Methods
static AsymmetricKeyParameter createKey(byte[] privateKeyInfoData)
Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.
static AsymmetricKeyParameter createKey(InputStream inStr)
Create a private key parameter from a PKCS8 PrivateKeyInfo encoding read from a stream.
static AsymmetricKeyParameter createKey(PrivateKeyInfo keyInfo)
Create a private key parameter from the passed in PKCS8 PrivateKeyInfo object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PrivateKeyFactory ()

Public Methods

public static AsymmetricKeyParameter createKey (byte[] privateKeyInfoData)

Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.

Parameters
privateKeyInfoData the PrivateKeyInfo encoding
Returns
  • a suitable private key parameter
Throws
IOException on an error decoding the key

public static AsymmetricKeyParameter createKey (InputStream inStr)

Create a private key parameter from a PKCS8 PrivateKeyInfo encoding read from a stream.

Parameters
inStr the stream to read the PrivateKeyInfo encoding from
Returns
  • a suitable private key parameter
Throws
IOException on an error decoding the key

public static AsymmetricKeyParameter createKey (PrivateKeyInfo keyInfo)

Create a private key parameter from the passed in PKCS8 PrivateKeyInfo object.

Parameters
keyInfo the PrivateKeyInfo object containing the key material
Returns
  • a suitable private key parameter
Throws
IOException on an error decoding the key