org.gudy.bouncycastle.asn1.pkcs
Class RSAPrivateKeyStructure

java.lang.Object
  extended by org.gudy.bouncycastle.asn1.ASN1Encodable
      extended by org.gudy.bouncycastle.asn1.pkcs.RSAPrivateKeyStructure
All Implemented Interfaces:
DEREncodable

public class RSAPrivateKeyStructure
extends ASN1Encodable


Field Summary
 
Fields inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
BER, DER
 
Constructor Summary
RSAPrivateKeyStructure(ASN1Sequence seq)
           
RSAPrivateKeyStructure(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger prime1, BigInteger prime2, BigInteger exponent1, BigInteger exponent2, BigInteger coefficient)
           
 
Method Summary
 BigInteger getCoefficient()
           
 BigInteger getExponent1()
           
 BigInteger getExponent2()
           
static RSAPrivateKeyStructure getInstance(ASN1TaggedObject obj, boolean explicit)
           
static RSAPrivateKeyStructure getInstance(Object obj)
           
 BigInteger getModulus()
           
 BigInteger getPrime1()
           
 BigInteger getPrime2()
           
 BigInteger getPrivateExponent()
           
 BigInteger getPublicExponent()
           
 int getVersion()
           
 DERObject toASN1Object()
          This outputs the key in PKCS1v2 format.
 
Methods inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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

getInstance

public static RSAPrivateKeyStructure getInstance(ASN1TaggedObject obj,
                                                 boolean explicit)

getInstance

public static RSAPrivateKeyStructure getInstance(Object obj)

getVersion

public int getVersion()

getModulus

public BigInteger getModulus()

getPublicExponent

public BigInteger getPublicExponent()

getPrivateExponent

public BigInteger getPrivateExponent()

getPrime1

public BigInteger getPrime1()

getPrime2

public BigInteger getPrime2()

getExponent1

public BigInteger getExponent1()

getExponent2

public BigInteger getExponent2()

getCoefficient

public BigInteger getCoefficient()

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.

Specified by:
toASN1Object in class ASN1Encodable