derRepresentation
A Distinguished Encoding Rules (DER) encoded representation of the public key.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
var derRepresentation: Data { get }
A Distinguished Encoding Rules (DER) encoded representation of the public key.
var derRepresentation: Data { get }
s6Crypto4P256O12KeyAgreementO06PublicC0V17derRepresentation20FoundationEssentials4DataVvp
What are these?8S97L
import Crypto
A cryptography library for Swift.
struct PublicKey
A P-256 public key used for key agreement.
enum P256
An elliptic curve that enables NIST P-256 signatures and key agreement.
enum KeyAgreement
A mechanism used to create a shared secret between two users by performing NIST P-256 elliptic curve Diffie Hellman (ECDH) key exchange.
@frozen struct Data
init<D>(_ serialization: D, kem: HPKE.KEM) throws where D : ContiguousBytes
Creates a NIST P-256 elliptic curve public key for use with Diffie-Hellman key exchange.
init<Bytes>(compactRepresentation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-256 public key for key agreement from a compact representation of the key.
init<Bytes>(compressedRepresentation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-256 public key for key agreement from a compressed representation of the key.
init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8
Creates a P-256 public key for key agreement from a Distinguished Encoding Rules (DER) encoded representation.
init(pemRepresentation: String) throws
Creates a P-256 public key for key agreement from a Privacy-Enhanced Mail (PEM) representation.
init<D>(rawRepresentation: D) throws where D : ContiguousBytes
Creates a P-256 public key for key agreement from a collection of bytes.
init<Bytes>(x963Representation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-256 public key for key agreement from an ANSI x9.63 representation.
var compactRepresentation: Data? { get }
A compact representation of the public key.
var compressedRepresentation: Data { get }
A compressed representation of the public key.
var pemRepresentation: String { get }
A Privacy-Enhanced Mail (PEM) representation of the public key.
var rawRepresentation: Data { get }
A full representation of the public key.
var x963Representation: Data { get }
An ANSI x9.63 representation of the public key.
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data
Creates a serialized representation of the public key.
typealias EphemeralPrivateKey = P256.KeyAgreement.PrivateKey
The type of the ephemeral private key associated with this public key.
typealias HPKEEphemeralPrivateKey = P256.KeyAgreement.PrivateKey
The type of the ephemeral private key associated with this public key.