Class RSAPrivateKey

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.pkcs.RSAPrivateKey
All Implemented Interfaces:
ASN1Encodable, Encodable

public class RSAPrivateKey extends ASN1Object
  • Constructor Details

  • Method Details

    • getInstance

      public static RSAPrivateKey getInstance(ASN1TaggedObject obj, boolean explicit)
    • getInstance

      public static RSAPrivateKey getInstance(Object obj)
    • getVersion

      public BigInteger 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()
    • toASN1Primitive

      public ASN1Primitive toASN1Primitive()
      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:
      toASN1Primitive in interface ASN1Encodable
      Specified by:
      toASN1Primitive in class ASN1Object
      Returns:
      a primitive representation of this object.