mirror of
https://github.com/apple/swift-certificates
synced 2026-11-26 04:47:48 +00:00
Most of the time, the signature algorithm that should be used is dictated by the type of the private key. * Ed25519 keys support only one signature algorithm. * RFC 5753 section 8 recommends that "[the P-256 curve] be used with SHA-256; the P-384 curve be used with SHA-384; and the P-521 curve be used with SHA-512". * RSA keys support 4 signature algorithms. But most people use RSA with SHA-256 and nobody should use RSA with SHA-1 anymore. More over, Certificate.PrivateKey is opaque to the user, who may not know what type of private key they're using and what the appropriate signature algorithm is. For those reasons, we add convenience wrappers around methods with a signature algorithm to provide a reasonable default value. --------- Co-authored-by: Cory Benfield <lukasa@apple.com>