Table of Contents

Class PrivateKeyInfo

Namespace
Org.BouncyCastle.Asn1.Pkcs
Assembly
BouncyCastle.Cryptography.dll
public class PrivateKeyInfo : Asn1Encodable, IAsn1Convertible
Inheritance
PrivateKeyInfo
Implements
Inherited Members

Constructors

PrivateKeyInfo(AlgorithmIdentifier, Asn1Encodable)

public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey)

Parameters

privateKeyAlgorithm AlgorithmIdentifier
privateKey Asn1Encodable

PrivateKeyInfo(AlgorithmIdentifier, Asn1Encodable, Asn1Set)

public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey, Asn1Set attributes)

Parameters

privateKeyAlgorithm AlgorithmIdentifier
privateKey Asn1Encodable
attributes Asn1Set

PrivateKeyInfo(AlgorithmIdentifier, Asn1Encodable, Asn1Set, byte[])

public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey, Asn1Set attributes, byte[] publicKey)

Parameters

privateKeyAlgorithm AlgorithmIdentifier
privateKey Asn1Encodable
attributes Asn1Set
publicKey byte[]

Properties

Attributes

public virtual Asn1Set Attributes { get; }

Property Value

Asn1Set

HasPublicKey

Return true if a public key is present, false otherwise.

public virtual bool HasPublicKey { get; }

Property Value

bool

PrivateKey

public virtual Asn1OctetString PrivateKey { get; }

Property Value

Asn1OctetString

PrivateKeyAlgorithm

public virtual AlgorithmIdentifier PrivateKeyAlgorithm { get; }

Property Value

AlgorithmIdentifier

PrivateKeyData

[Obsolete("Use 'PrivateKey' instead")]
public virtual Asn1OctetString PrivateKeyData { get; }

Property Value

Asn1OctetString

PrivateKeyLength

public virtual int PrivateKeyLength { get; }

Property Value

int

PublicKey

public virtual DerBitString PublicKey { get; }

Property Value

DerBitString

PublicKeyData

Return the public key as a raw bit string.

[Obsolete("Use 'PublicKey' instead")]
public virtual DerBitString PublicKeyData { get; }

Property Value

DerBitString

Version

public virtual DerInteger Version { get; }

Property Value

DerInteger

Methods

Create(AlgorithmIdentifier, Asn1OctetString, Asn1Set, DerBitString)

public static PrivateKeyInfo Create(AlgorithmIdentifier privateKeyAlgorithm, Asn1OctetString privateKey, Asn1Set attributes, DerBitString publicKey)

Parameters

privateKeyAlgorithm AlgorithmIdentifier
privateKey Asn1OctetString
attributes Asn1Set
publicKey DerBitString

Returns

PrivateKeyInfo

GetInstance(Asn1TaggedObject, bool)

public static PrivateKeyInfo GetInstance(Asn1TaggedObject obj, bool explicitly)

Parameters

obj Asn1TaggedObject
explicitly bool

Returns

PrivateKeyInfo

GetInstance(object)

public static PrivateKeyInfo GetInstance(object obj)

Parameters

obj object

Returns

PrivateKeyInfo

GetOptional(Asn1Encodable)

public static PrivateKeyInfo GetOptional(Asn1Encodable element)

Parameters

element Asn1Encodable

Returns

PrivateKeyInfo

GetTagged(Asn1TaggedObject, bool)

public static PrivateKeyInfo GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)

Parameters

taggedObject Asn1TaggedObject
declaredExplicit bool

Returns

PrivateKeyInfo

ParsePrivateKey()

public virtual Asn1Object ParsePrivateKey()

Returns

Asn1Object

ParsePublicKey()

For when the public key is an ASN.1 encoding.

public virtual Asn1Object ParsePublicKey()

Returns

Asn1Object

ToAsn1Object()

public override Asn1Object ToAsn1Object()

Returns

Asn1Object