Initializerswift-crypto 3.8.0Crypto
init(compressedRepresentation:)
Creates a P-521 public key for key agreement from a compressed representation of the key.
ECDH.swift:1149init<Bytes>(compressedRepresentation: Bytes) throws where Bytes : ContiguousBytes
Parameters
- compressedRepresentation
A compressed representation of the key as a collection of contiguous bytes.
Other members in extension
Typealiases
typealias EphemeralPrivateKey
The type of the ephemeral private key associated with this public key.
typealias HPKEEphemeralPrivateKey
The type of the ephemeral private key associated with this public key.
Type members
init<D>(D, kem: HPKE.KEM
) throws Creates a NIST P-521 elliptic curve public key for use with Diffie-Hellman key exchange.
init<Bytes>(compactRepresentation: Bytes
) throws Creates a P-521 public key for key agreement from a compact representation of the key.
init<Bytes>(derRepresentation: Bytes
) throws Creates a P-521 public key for key agreement from a Distinguished Encoding Rules (DER) encoded representation.
init(pemRepresentation: String
) throws Creates a P-521 public key for key agreement from a Privacy-Enhanced Mail (PEM) representation.
init<D>(rawRepresentation: D
) throws Creates a P-521 public key for key agreement from a collection of bytes.
init<Bytes>(x963Representation: Bytes
) throws Creates a P-521 public key for key agreement from an ANSI x9.63 representation.
Instance members
var compactRepresentation: Data?
A compact representation of the public key.
var compressedRepresentation: Data
A compressed representation of the public key.
var derRepresentation: Data
A Distinguished Encoding Rules (DER) encoded representation of the public key.
var pemRepresentation: String
A Privacy-Enhanced Mail (PEM) representation of the public key.
var rawRepresentation: Data
A full representation of the public key.
var x963Representation: Data
An ANSI x9.63 representation of the public key.
func hpkeRepresentation(kem: HPKE.KEM
) throws -> Data Creates a serialized representation of the public key.