Top Description Constructors Methods
org.bouncycastle.crypto.util

public Class PrivateKeyFactory

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.math.BigInteger, org.bouncycastle.asn1.ASN1Encodable, .ASN1InputStream, .ASN1Integer, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Primitive, .ASN1Sequence, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, .ECGOST3410NamedCurves, .GOST3410PublicKeyAlgParameters, org.bouncycastle.asn1.edec.EdECObjectIdentifiers, org.bouncycastle.asn1.oiw.ElGamalParameter, .OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.DHParameter, .PKCSObjectIdentifiers, .PrivateKeyInfo, .RSAPrivateKey, org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.asn1.sec.ECPrivateKey, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .DSAParameter, .X509ObjectIdentifiers, org.bouncycastle.asn1.x9.ECNamedCurveTable, .X962Parameters, .X9ECParameters, .X9ObjectIdentifiers, org.bouncycastle.crypto.ec.CustomNamedCurves, org.bouncycastle.crypto.params.AsymmetricKeyParameter, .DHParameters, .DHPrivateKeyParameters, .DSAParameters, .DSAPrivateKeyParameters, .ECDomainParameters, .ECGOST3410Parameters, .ECNamedDomainParameters, .ECPrivateKeyParameters, .Ed25519PrivateKeyParameters, .Ed448PrivateKeyParameters, .ElGamalParameters, .ElGamalPrivateKeyParameters, .RSAPrivateCrtKeyParameters, .X25519PrivateKeyParameters, .X448PrivateKeyParameters, org.bouncycastle.util.Arrays

Factory for creating private key objects from PKCS8 PrivateKeyInfo objects.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static AsymmetricKeyParameter

Returns:

a suitable private key parameter
createKey
(byte[]
the PrivateKeyInfo encoding
privateKeyInfoData
)

Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.

public static AsymmetricKeyParameter

Returns:

a suitable private key parameter
createKey
(InputStream
the stream to read the PrivateKeyInfo encoding from
inStr
)

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

public static AsymmetricKeyParameter

Returns:

a suitable private key parameter
createKey
(PrivateKeyInfo
the PrivateKeyInfo object containing the key material
keyInfo
)

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

private static byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivateKeyFactoryback to summary
public PrivateKeyFactory()

Method Detail

createKeyback to summary
public static AsymmetricKeyParameter createKey(byte[] privateKeyInfoData) throws IOException

Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.

Parameters
privateKeyInfoData:byte[]

the PrivateKeyInfo encoding

Returns:AsymmetricKeyParameter

a suitable private key parameter

Exceptions
IOException:
on an error decoding the key
createKeyback to summary
public static AsymmetricKeyParameter createKey(InputStream inStr) throws IOException

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

Parameters
inStr:InputStream

the stream to read the PrivateKeyInfo encoding from

Returns:AsymmetricKeyParameter

a suitable private key parameter

Exceptions
IOException:
on an error decoding the key
createKeyback to summary
public static AsymmetricKeyParameter createKey(PrivateKeyInfo keyInfo) throws IOException

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

Parameters
keyInfo:PrivateKeyInfo

the PrivateKeyInfo object containing the key material

Returns:AsymmetricKeyParameter

a suitable private key parameter

Exceptions
IOException:
on an error decoding the key
getRawKeyback to summary
private static byte[] getRawKey(PrivateKeyInfo keyInfo) throws IOException