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

public Class PrivateKeyInfoFactory

extends Object
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, java.util.HashSet, .Set, org.bouncycastle.asn1.ASN1Encodable, .ASN1Integer, .ASN1ObjectIdentifier, .ASN1Set, .DERBitString, .DERNull, .DEROctetString, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, .GOST3410PublicKeyAlgParameters, org.bouncycastle.asn1.edec.EdECObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, .PrivateKeyInfo, .RSAPrivateKey, org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.asn1.sec.ECPrivateKey, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .DSAParameter, org.bouncycastle.asn1.x9.X962Parameters, .X9ECParameters, .X9ECPoint, .X9ObjectIdentifiers, org.bouncycastle.crypto.params.AsymmetricKeyParameter, .DSAParameters, .DSAPrivateKeyParameters, .ECDomainParameters, .ECGOST3410Parameters, .ECNamedDomainParameters, .ECPrivateKeyParameters, .Ed25519PrivateKeyParameters, .Ed448PrivateKeyParameters, .RSAKeyParameters, .RSAPrivateCrtKeyParameters, .X25519PrivateKeyParameters, .X448PrivateKeyParameters, org.bouncycastle.math.ec.ECPoint, .FixedPointCombMultiplier

Factory to create ASN.1 private key info objects from lightweight private keys.

Field Summary

Modifier and TypeField and Description
private static Set<E>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PrivateKeyInfo

Returns:

the appropriate PrivateKeyInfo
createPrivateKeyInfo
(AsymmetricKeyParameter
the key to be encoded into the info object.
privateKey
)

Create a PrivateKeyInfo representation of a private key.

public static PrivateKeyInfo

Returns:

the appropriate PrivateKeyInfo
createPrivateKeyInfo
(AsymmetricKeyParameter
the key to be encoded into the info object.
privateKey
,
ASN1Set
the set of attributes to be included.
attributes
)

Create a PrivateKeyInfo representation of a private key with attributes.

private static void
extractBytes(byte[] encKey, int size, int offSet, BigInteger bI)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cryptoProOidsback to summary
private static Set<E> cryptoProOids

Constructor Detail

PrivateKeyInfoFactoryback to summary
private PrivateKeyInfoFactory()

Method Detail

createPrivateKeyInfoback to summary
public static PrivateKeyInfo createPrivateKeyInfo(AsymmetricKeyParameter privateKey) throws IOException

Create a PrivateKeyInfo representation of a private key.

Parameters
privateKey:AsymmetricKeyParameter

the key to be encoded into the info object.

Returns:PrivateKeyInfo

the appropriate PrivateKeyInfo

Exceptions
IOException:
on an error encoding the key
createPrivateKeyInfoback to summary
public static PrivateKeyInfo createPrivateKeyInfo(AsymmetricKeyParameter privateKey, ASN1Set attributes) throws IOException

Create a PrivateKeyInfo representation of a private key with attributes.

Parameters
privateKey:AsymmetricKeyParameter

the key to be encoded into the info object.

attributes:ASN1Set

the set of attributes to be included.

Returns:PrivateKeyInfo

the appropriate PrivateKeyInfo

Exceptions
IOException:
on an error encoding the key
extractBytesback to summary
private static void extractBytes(byte[] encKey, int size, int offSet, BigInteger bI)