org.bouncycastle.asn1.pkcs

Class RSAPrivateKeyStructure

public class RSAPrivateKeyStructure extends ASN1Encodable

Constructor Summary
RSAPrivateKeyStructure(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger prime1, BigInteger prime2, BigInteger exponent1, BigInteger exponent2, BigInteger coefficient)
RSAPrivateKeyStructure(ASN1Sequence seq)
Method Summary
BigIntegergetCoefficient()
BigIntegergetExponent1()
BigIntegergetExponent2()
static RSAPrivateKeyStructuregetInstance(ASN1TaggedObject obj, boolean explicit)
static RSAPrivateKeyStructuregetInstance(Object obj)
BigIntegergetModulus()
BigIntegergetPrime1()
BigIntegergetPrime2()
BigIntegergetPrivateExponent()
BigIntegergetPublicExponent()
intgetVersion()
DERObjecttoASN1Object()
This outputs the key in PKCS1v2 format.

Constructor Detail

RSAPrivateKeyStructure

public RSAPrivateKeyStructure(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger prime1, BigInteger prime2, BigInteger exponent1, BigInteger exponent2, BigInteger coefficient)

RSAPrivateKeyStructure

public RSAPrivateKeyStructure(ASN1Sequence seq)

Method Detail

getCoefficient

public BigInteger getCoefficient()

getExponent1

public BigInteger getExponent1()

getExponent2

public BigInteger getExponent2()

getInstance

public static RSAPrivateKeyStructure getInstance(ASN1TaggedObject obj, boolean explicit)

getInstance

public static RSAPrivateKeyStructure getInstance(Object obj)

getModulus

public BigInteger getModulus()

getPrime1

public BigInteger getPrime1()

getPrime2

public BigInteger getPrime2()

getPrivateExponent

public BigInteger getPrivateExponent()

getPublicExponent

public BigInteger getPublicExponent()

getVersion

public int getVersion()

toASN1Object

public DERObject toASN1Object()
This outputs the key in PKCS1v2 format.
      RSAPrivateKey ::= SEQUENCE {
                          version Version,
                          modulus INTEGER, -- n
                          publicExponent INTEGER, -- e
                          privateExponent INTEGER, -- d
                          prime1 INTEGER, -- p
                          prime2 INTEGER, -- q
                          exponent1 INTEGER, -- d mod (p-1)
                          exponent2 INTEGER, -- d mod (q-1)
                          coefficient INTEGER, -- (inverse of q) mod p
                          otherPrimeInfos OtherPrimeInfos OPTIONAL
                      }

      Version ::= INTEGER { two-prime(0), multi(1) }
        (CONSTRAINED BY {-- version must be multi if otherPrimeInfos present --})
 

This routine is written to output PKCS1 version 2.1, private keys.