PublicKey
RSA.swift:55- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
struct PublicKey
struct PublicKey
import _CryptoExtras
Provides additional cryptographic APIs that are not available in CryptoKit (and therefore the core Crypto library).
enum Signing
enum _RSA
Types associated with the RSA algorithm
struct KeySize
struct Padding
struct PrivateKey
struct RSASignature
protocol Sendable
init<Bytes>(derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA public key from a DER representation.
init(n: some ContiguousBytes, e: some ContiguousBytes) throws
Construct an RSA public key with the specified parameters.
init(pemRepresentation: String) throws
Construct an RSA public key from a PEM representation.
init<Bytes>(unsafeDERRepresentation derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA public key from a DER representation.
init(unsafePEMRepresentation pemRepresentation: String) throws
Construct an RSA public key from a PEM representation.
var derRepresentation: Data { get }
var keySizeInBits: Int { get }
var pemRepresentation: String { get }
var pkcs1DERRepresentation: Data { get }
var pkcs1PEMRepresentation: String { get }
func getKeyPrimitives() throws -> Primitives
func isValidSignature<D>(_ signature: _RSA.Signing.RSASignature, for digest: D) -> Bool where D : Digest
Verifies an RSA signature with the given padding over a given digest using the default padding.
func isValidSignature<D>(_ signature: _RSA.Signing.RSASignature, for data: D) -> Bool where D : DataProtocol
Verifies an RSA signature with the given padding over a message with the default padding.
func isValidSignature<D>(_ signature: _RSA.Signing.RSASignature, for digest: D, padding: _RSA.Signing.Padding) -> Bool where D : Digest
Verifies an RSA signature with the given padding over a given digest.
func isValidSignature<D>(_ signature: _RSA.Signing.RSASignature, for data: D, padding: _RSA.Signing.Padding) -> Bool where D : DataProtocol
Verifies an RSA signature with the given padding over a message. SHA256 is used as the hash function.
struct Primitives