Top Description Constructors Methods
org.bouncycastle.pqc.crypto.util

public Class PrivateKeyFactory

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, org.bouncycastle.asn1.ASN1BitString, .ASN1Encodable, .ASN1InputStream, .ASN1Integer, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Primitive, .ASN1Sequence, .DEROctetString, org.bouncycastle.asn1.bc.BCObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, .PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.params.AsymmetricKeyParameter, org.bouncycastle.pqc.asn1.CMCEPrivateKey, .FalconPrivateKey, .McElieceCCA2PrivateKey, .PQCObjectIdentifiers, .SPHINCS256KeyParams, .SPHINCSPLUSPrivateKey, .SPHINCSPLUSPublicKey, .XMSSKeyParams, .XMSSMTKeyParams, .XMSSMTPrivateKey, .XMSSPrivateKey, org.bouncycastle.pqc.crypto.bike.BIKEParameters, .BIKEPrivateKeyParameters, org.bouncycastle.pqc.crypto.cmce.CMCEParameters, .CMCEPrivateKeyParameters, org.bouncycastle.pqc.crypto.crystals.dilithium.DilithiumParameters, .DilithiumPrivateKeyParameters, .DilithiumPublicKeyParameters, org.bouncycastle.pqc.crypto.crystals.kyber.KyberParameters, .KyberPrivateKeyParameters, org.bouncycastle.pqc.crypto.falcon.FalconParameters, .FalconPrivateKeyParameters, org.bouncycastle.pqc.crypto.frodo.FrodoParameters, .FrodoPrivateKeyParameters, org.bouncycastle.pqc.crypto.hqc.HQCParameters, .HQCPrivateKeyParameters, org.bouncycastle.pqc.crypto.lms.HSSPrivateKeyParameters, .LMSPrivateKeyParameters, org.bouncycastle.pqc.crypto.newhope.NHPrivateKeyParameters, org.bouncycastle.pqc.crypto.ntru.NTRUParameters, .NTRUPrivateKeyParameters, org.bouncycastle.pqc.crypto.ntruprime.NTRULPRimeParameters, .NTRULPRimePrivateKeyParameters, .SNTRUPrimeParameters, .SNTRUPrimePrivateKeyParameters, org.bouncycastle.pqc.crypto.picnic.PicnicParameters, .PicnicPrivateKeyParameters, org.bouncycastle.pqc.crypto.rainbow.RainbowParameters, .RainbowPrivateKeyParameters, org.bouncycastle.pqc.crypto.saber.SABERParameters, .SABERPrivateKeyParameters, org.bouncycastle.pqc.crypto.sphincs.SPHINCSPrivateKeyParameters, org.bouncycastle.pqc.crypto.sphincsplus.SPHINCSPlusParameters, .SPHINCSPlusPrivateKeyParameters, org.bouncycastle.pqc.crypto.xmss.BDS, .BDSStateMap, .XMSSMTParameters, .XMSSMTPrivateKeyParameters, .XMSSParameters, .XMSSPrivateKeyParameters, .XMSSUtil, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceCCA2PrivateKeyParameters, org.bouncycastle.pqc.legacy.crypto.qtesla.QTESLAPrivateKeyParameters, org.bouncycastle.util.Arrays, .Pack

Factory for creating private key objects from PKCS8 PrivateKeyInfo objects.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static short[]
convert(byte[] octets)

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivateKeyFactoryback to summary
public PrivateKeyFactory()

Method Detail

convertback to summary
private static short[] convert(byte[] octets)
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