org.bouncycastle.asn1.pkcs

Class PrivateKeyInfo

public class PrivateKeyInfo extends ASN1Encodable

Constructor Summary
PrivateKeyInfo(AlgorithmIdentifier algId, DERObject privateKey)
PrivateKeyInfo(AlgorithmIdentifier algId, DERObject privateKey, ASN1Set attributes)
PrivateKeyInfo(ASN1Sequence seq)
Method Summary
AlgorithmIdentifiergetAlgorithmId()
ASN1SetgetAttributes()
static PrivateKeyInfogetInstance(ASN1TaggedObject obj, boolean explicit)
static PrivateKeyInfogetInstance(Object obj)
DERObjectgetPrivateKey()
DERObjecttoASN1Object()
write out an RSA private key with it's asscociated information as described in PKCS8.

Constructor Detail

PrivateKeyInfo

public PrivateKeyInfo(AlgorithmIdentifier algId, DERObject privateKey)

PrivateKeyInfo

public PrivateKeyInfo(AlgorithmIdentifier algId, DERObject privateKey, ASN1Set attributes)

PrivateKeyInfo

public PrivateKeyInfo(ASN1Sequence seq)

Method Detail

getAlgorithmId

public AlgorithmIdentifier getAlgorithmId()

getAttributes

public ASN1Set getAttributes()

getInstance

public static PrivateKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)

getInstance

public static PrivateKeyInfo getInstance(Object obj)

getPrivateKey

public DERObject getPrivateKey()

toASN1Object

public DERObject toASN1Object()
write out an RSA private key with it's asscociated information as described in PKCS8.
      PrivateKeyInfo ::= SEQUENCE {
                              version Version,
                              privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
                              privateKey PrivateKey,
                              attributes [0] IMPLICIT Attributes OPTIONAL 
                          }
      Version ::= INTEGER {v1(0)} (v1,...)

      PrivateKey ::= OCTET STRING

      Attributes ::= SET OF Attribute