isValidSignature(_:for:)

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

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

Parameters

signature

The signature to verify

digest

The digest that was signed.

Returns

True if the signature is valid, false otherwise.

The default padding is PSS using MGF1 with same hash function as produced the digest being signed, and a salt that is as long as the digest. Note that this API will not select any known-insecure digests.