#[repr(u32)]pub enum EncryptionAlgorithm {
RsaEncryptionRaw = 0,
RsaEncryptionPkcs1 = 1,
RsaEncryptionOaepSha1 = 2,
RsaEncryptionOaepSha224 = 3,
RsaEncryptionOaepSha256 = 4,
RsaEncryptionOaepSha384 = 5,
RsaEncryptionOaepSha512 = 6,
RsaEncryptionOaepSha1AesGcm = 7,
RsaEncryptionOaepSha224AesGcm = 8,
RsaEncryptionOaepSha256AesGcm = 9,
RsaEncryptionOaepSha384AesGcm = 10,
RsaEncryptionOaepSha512AesGcm = 11,
}Expand description
Mirrors encryption cases from SecKeyAlgorithm.
Variants§
RsaEncryptionRaw = 0
Mirrors kSecKeyAlgorithmRSAEncryptionRaw: textbook RSA without padding. It is
deterministic and malleable, so never use it to encrypt data; it only exists for
implementing other padding schemes. Prefer an OAEP variant.
RsaEncryptionPkcs1 = 1
Mirrors kSecKeyAlgorithmRSAEncryptionPKCS1: PKCS#1 v1.5 padding, which is open to
padding-oracle (Bleichenbacher) attacks whenever decryption failures are observable.
Use it only for interoperability; prefer an OAEP variant.
RsaEncryptionOaepSha1 = 2
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha224 = 3
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha256 = 4
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha384 = 5
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha512 = 6
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha1AesGcm = 7
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha224AesGcm = 8
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha256AesGcm = 9
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha384AesGcm = 10
Mirrors a SecKeyAlgorithm encryption constant.
RsaEncryptionOaepSha512AesGcm = 11
Mirrors a SecKeyAlgorithm encryption constant.