isValidSignature(_:for:)

Verifies an RSA signature with the given padding over a message with the default padding.

RSA.swift:434
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
func isValidSignature<D>(_ signature: _RSA.Signing.RSASignature, for data: D) -> Bool where D : DataProtocol

Parameters

signature

The signature to verify

data

The data that was signed.

Returns

True if the signature is valid, false otherwise.

SHA256 is used as the hash function. The default padding is PSS using MGF1 with SHA256 and a 32-byte salt.