Initializerswift-crypto 3.8.0_CryptoExtras
init(n:e:)
Construct an RSA public key with the specified parameters.
RSA.swift:114init(n: some ContiguousBytes, e: some ContiguousBytes) throws
Only the BoringSSL backend provides APIs to create a key from its parameters so we first create a BoringSSL key, and then pass it to the platform-specific initializer that accepts a BoringSSL key.
On Darwin platforms, this will serialize it to PEM format, and then construct a platform-specific key from the PEM representation.
Other members in extension
Types
Type members
init<Bytes>(derRepresentation: Bytes
) throws Construct an RSA public key from a DER representation.
init(pemRepresentation: String
) throws Construct an RSA public key from a PEM representation.
init<Bytes>(unsafeDERRepresentation: Bytes
) throws Construct an RSA public key from a DER representation.
init(unsafePEMRepresentation: String
) throws Construct an RSA public key from a PEM representation.
Instance members
var derRepresentation: Data
var keySizeInBits: Int
var pemRepresentation: String
var pkcs1DERRepresentation: Data
var pkcs1PEMRepresentation: String
func getKeyPrimitives(
) throws -> Primitives func isValidSignature<D>(_RSA.Signing.RSASignature, for: D
) -> Bool Verifies an RSA signature with the given padding over a given digest using the default padding.
func isValidSignature<D>(_RSA.Signing.RSASignature, for: D
) -> Bool Verifies an RSA signature with the given padding over a message with the default padding.
func isValidSignature<D>(_RSA.Signing.RSASignature, for: D, padding: _RSA.Signing.Padding
) -> Bool Verifies an RSA signature with the given padding over a given digest.
func isValidSignature<D>(_RSA.Signing.RSASignature, for: D, padding: _RSA.Signing.Padding
) -> Bool Verifies an RSA signature with the given padding over a message. SHA256 is used as the hash function.