Class RsaKey
Contains the RSA private and public key.
public class RsaKey : Key, IDisposable
- Inheritance
-
RsaKey
- Implements
- Inherited Members
Constructors
RsaKey(BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger)
Initializes a new instance of the RsaKey class.
public RsaKey(BigInteger modulus, BigInteger exponent, BigInteger d, BigInteger p, BigInteger q, BigInteger inverseQ)
Parameters
modulus
BigIntegerThe modulus.
exponent
BigIntegerThe exponent.
d
BigIntegerThe d.
p
BigIntegerThe p.
q
BigIntegerThe q.
inverseQ
BigIntegerThe inverse Q.
RsaKey(SshKeyData)
Initializes a new instance of the RsaKey class.
public RsaKey(SshKeyData publicKeyData)
Parameters
publicKeyData
SshKeyDataThe encoded public key data.
RsaKey(byte[])
Initializes a new instance of the RsaKey class.
public RsaKey(byte[] privateKeyData)
Parameters
privateKeyData
byte[]DER encoded private key data.
Properties
D
Gets the D.
public BigInteger D { get; }
Property Value
- BigInteger
The D.
DP
Gets the DP.
public BigInteger DP { get; }
Property Value
- BigInteger
The DP.
DQ
Gets the DQ.
public BigInteger DQ { get; }
Property Value
- BigInteger
The DQ.
DigitalSignature
Gets the digital signature implementation for this key.
protected override DigitalSignature DigitalSignature { get; }
Property Value
- DigitalSignature
An implementation of an RSA digital signature using the SHA-1 hash algorithm.
Exponent
Gets the exponent.
public BigInteger Exponent { get; }
Property Value
- BigInteger
The exponent.
InverseQ
Gets the inverse Q.
public BigInteger InverseQ { get; }
Property Value
- BigInteger
The inverse Q.
KeyLength
Gets the length of the key.
public override int KeyLength { get; }
Property Value
- int
The length of the key.
Modulus
Gets the modulus.
public BigInteger Modulus { get; }
Property Value
- BigInteger
The modulus.
P
Gets the P.
public BigInteger P { get; }
Property Value
- BigInteger
The P.
Public
Gets the RSA public key.
public override BigInteger[] Public { get; }
Property Value
Q
Gets the Q.
public BigInteger Q { get; }
Property Value
- BigInteger
The Q.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
booltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
ToString()
Gets the name of the key.
public override string ToString()
Returns
- string
The name of the key.