• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class RsaKeyReader

Reads RSA keys from PEM or DER and creates BCL RSA instances. Supports PKCS#1 (RSAPrivateKey, RSAPublicKey), PKCS#8 PrivateKeyInfo, and SubjectPublicKeyInfo.

Inheritance
object
RsaKeyReader
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Mail.Rfc.Crypto
Assembly: DRIT.Mail.dll
Syntax
public static class RsaKeyReader

Methods

View Source

CreateFromPrivateKeyPem(string)

Creates an RSA instance from a PEM-encoded RSA private key.

Declaration
public static RSA CreateFromPrivateKeyPem(string pemText)
Parameters
Type Name Description
string pemText

The pem text used by the operation.

Returns
Type Description
RSA
View Source

CreateFromPublicKeyPem(string)

Creates an RSA instance from a PEM-encoded RSA public key.

Declaration
public static RSA CreateFromPublicKeyPem(string pemText)
Parameters
Type Name Description
string pemText

The pem text used by the operation.

Returns
Type Description
RSA
View Source

ReadPkcs1PrivateKey(byte[])

Reads a PKCS#1 RSAPrivateKey from DER bytes.

Declaration
public static RSAParameters ReadPkcs1PrivateKey(byte[] der)
Parameters
Type Name Description
byte[] der

Specifies the der value.

Returns
Type Description
RSAParameters
View Source

ReadPkcs1PublicKey(byte[])

Reads a PKCS#1 RSAPublicKey from DER bytes.

Declaration
public static RSAParameters ReadPkcs1PublicKey(byte[] der)
Parameters
Type Name Description
byte[] der

Specifies the der value.

Returns
Type Description
RSAParameters
View Source

ReadPkcs8PrivateKey(byte[])

Reads a PKCS#8 PrivateKeyInfo containing an RSA private key.

Declaration
public static RSAParameters ReadPkcs8PrivateKey(byte[] der)
Parameters
Type Name Description
byte[] der

Specifies the der value.

Returns
Type Description
RSAParameters
View Source

ReadPrivateKeyFromPem(string)

Reads an RSA private key from PEM text. Supports both RSA PRIVATE KEY (PKCS#1) and PRIVATE KEY (PKCS#8) labels.

Declaration
public static RSAParameters ReadPrivateKeyFromPem(string pemText)
Parameters
Type Name Description
string pemText

The pem text used by the operation.

Returns
Type Description
RSAParameters
View Source

ReadPublicKeyFromPem(string)

Reads an RSA public key from PEM text. Supports both RSA PUBLIC KEY (PKCS#1) and PUBLIC KEY (SubjectPublicKeyInfo) labels.

Declaration
public static RSAParameters ReadPublicKeyFromPem(string pemText)
Parameters
Type Name Description
string pemText

The pem text used by the operation.

Returns
Type Description
RSAParameters
View Source

ReadSubjectPublicKeyInfo(byte[])

Reads a SubjectPublicKeyInfo containing an RSA public key.

Declaration
public static RSAParameters ReadSubjectPublicKeyInfo(byte[] der)
Parameters
Type Name Description
byte[] der

Specifies the der value.

Returns
Type Description
RSAParameters
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX