Initializerswift-crypto 3.8.0Crypto
init(compactRepresentable:)
Creates a random P-384 private key for signing.
ECDH.swift:579init(compactRepresentable: Bool = true)
Parameters
- compactRepresentable
A Boolean value that indicates whether CryptoKit creates the key with the structure to enable compact point encoding.
Keys that use a compact point encoding enable shorter public keys, but aren’t compliant with FIPS certification. If your app requires FIPS certification, create a key with init(rawRepresentation:)
.
Other members in extension
Type members
init<Bytes>(derRepresentation: Bytes
) throws Creates a P-384 private key for signing from a Distinguished Encoding Rules (DER) encoded representation.
init(pemRepresentation: String
) throws Creates a P-384 private key for signing from a Privacy-Enhanced Mail PEM) representation.
init<Bytes>(rawRepresentation: Bytes
) throws Creates a P-384 private key for signing from a collection of bytes.
init<Bytes>(x963Representation: Bytes
) throws Creates a P-384 private key for signing from an ANSI x9.63 representation.
Instance members
var derRepresentation: Data
A Distinguished Encoding Rules (DER) encoded representation of the private key.
var pemRepresentation: String
A Privacy-Enhanced Mail (PEM) representation of the private key.
var publicKey: P384.Signing.PublicKey
The corresponding public key.
var rawRepresentation: Data
A data representation of the private key.
var x963Representation: Data
An ANSI x9.63 representation of the private key.
func signature<D>(for: D
) throws -> P384.Signing.ECDSASignature Generates an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the data you provide over the P-384 elliptic curve, using SHA-384 as the hash function.
func signature<D>(for: D
) throws -> P384.Signing.ECDSASignature Generates an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the digest you provide over the P-384 elliptic curve.