RsaFormat Class
Namespace: Yubico.YubiKey.Cryptography Assembly: Yubico.YubiKey.dllThis class contains methods that can build and read data formatted for RSA sign/verify and encryption/decryption operations.
public static class RsaFormat : Object
Remarks
Currently this class will format data into only PKCS #1 v1.5 and PKCS #1 v.2 PSS and OAEP constructions. Furthermore, this class will only build specific subsets of PSS and OAEP.
Note that there are attacks on RSA decryption unpadding operations. To learn more about these attacks, whether the YubiKey is vulnerable, and mitigations, see the User's Manual entry on the topic.
Fields
Name | Description |
---|---|
KeySizeBits1024 | Use this value to indicate the key size, in bits, is 1024. The
|
KeySizeBits2048 | Use this value to indicate the key size, in bits, is 2048. The
|
KeySizeBits3072 | Use this value to indicate the key size, in bits, is 3072. The
|
KeySizeBits4096 | Use this value to indicate the key size, in bits, is 4096. The
|
Sha1 | Use this value to indicate the digest algorithm is SHA-1. |
Sha256 | Use this value to indicate the digest algorithm is SHA-256. |
Sha384 | Use this value to indicate the digest algorithm is SHA-384. |
Sha512 | Use this value to indicate the digest algorithm is SHA-512. |
Methods
Name | Description |
---|---|
FormatPkcs1Encrypt(ReadOnlySpan<Byte>, Int32) | Build the input data into a PKCS #1 v1.5 formatted block for encryption (see RFC 8017). |
FormatPkcs1Oaep(ReadOnlySpan<Byte>, Int32, Int32) | Build the input data into a PKCS #1 v2 OAEP formatted block for encryption (see RFC 8017). |
FormatPkcs1Pss(ReadOnlySpan<Byte>, Int32, Int32) | Build the digest into a PKCS #1 v2 PSS formatted block for signing (see RFC 8017). |
FormatPkcs1Sign(ReadOnlySpan<Byte>, Int32, Int32) | Build the digest into a PKCS #1 v1.5 formatted block for signing (see RFC 8017). |
TryParsePkcs1Decrypt(ReadOnlySpan<Byte>, out Byte[]) | Try to parse the |
TryParsePkcs1Oaep(ReadOnlySpan<Byte>, Int32, out Byte[]) | Try to parse the |
TryParsePkcs1Pss(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, out Byte[], out Boolean) | Try to parse the |
TryParsePkcs1Verify(ReadOnlySpan<Byte>, out Int32, out Byte[]) | Try to parse the |