Creates a new RSAPrivateKey instance.
The CRT coefficient ((inverse of q) mod p)
The first exponent (d mod (p-1))
The second exponent (d mod (q-1))
The modulus (n)
The first prime factor (p)
The second prime factor (q)
The private exponent (d)
The exponent (e)
The version (always 0 for two-prime RSA)
Gets the PEM header name for this object type. Converts the class name to uppercase for use in PEM encoding.
Gets the PKI type name for this object (typically the class name). Used for PEM headers and debugging output.
Compares this PKI object with another for equality. Two objects are considered equal if their DER encodings are identical.
The other PKI object to compare with
true if the objects are equal, false otherwise
Parses this object as a different PKI type. Useful for converting between related PKI structures.
The target type to parse as
The target type constructor with parsing capabilities
A new instance of the target type
Converts the RSA private key to an ASN.1 structure.
Converts the RSA private key to DER format.
Returns a human-readable string representation of this object. By default, returns the same as toString(), but subclasses can override for more user-friendly output.
A human-readable string representation
Converts this PKI object to PEM (Privacy-Enhanced Mail) format.
A PEM-encoded string with appropriate headers
Extracts the RSA key component from this private key.
A new RSAPublicKey containing the parts of this key
Returns a string representation of this PKI object. Includes the type name and ASN.1 structure.
A string representation for debugging
Static
fromParses an ASN.1 structure to create an RSAPrivateKey.
The ASN.1 structure
A new RSAPrivateKey instance
Static
fromParses DER encoded data to create an RSAPrivateKey.
The DER encoded data
A new RSAPrivateKey instance
Static
fromParses PEM encoded data to create an RSAPrivateKey.
The PEM encoded data
A new RSAPrivateKey instance
Represents an RSA private key as defined in RFC 8017 (PKCS #1 v2.2).
This class specifically implements the RSAPrivateKey ASN.1 structure from PKCS #1, which differs from the generic PrivateKeyInfo structure defined in PKCS #8.
Use this class when:
For general private key handling (including non-RSA keys), use PrivateKeyInfo instead.
Asn