Initializerswift-crypto 3.8.0Crypto
init(derRepresentation:)
Creates a P-521 private key for signing from a Distinguished Encoding Rules (DER) encoded representation.
ECDH.swift:1055init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8
Parameters
- derRepresentation
A DER-encoded representation of the key.
Other members in extension
Type members
init(compactRepresentable: Bool
) Creates a random P-521 private key for signing.
init(pemRepresentation: String
) throws Creates a P-521 private key for signing from a Privacy-Enhanced Mail PEM) representation.
init<Bytes>(rawRepresentation: Bytes
) throws Creates a P-521 private key for signing from a collection of bytes.
init<Bytes>(x963Representation: Bytes
) throws Creates a P-521 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: P521.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 -> P521.Signing.ECDSASignature Generates an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the data you provide over the P-521 elliptic curve, using SHA-512 as the hash function.
func signature<D>(for: D
) throws -> P521.Signing.ECDSASignature Generates an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the digest you provide over the P-521 elliptic curve.