One Logo Pool Ball
CryptoKit · IOS API REFERENCE

P384.KeyAgreement.PublicKey

struct · iOS 13.0+ · SDK 27.1

struct PublicKey

A P-384 public key used for key agreement.

Members (14)

get · iOS 14.0+

derRepresentation

TypeScript
get derRepresentation(): ArrayBuffer
Swift declaration
var derRepresentation: Data { get }

A Distinguished Encoding Rules (DER) encoded representation of the public key.

init · iOS 14.0+

init

TypeScript
static initDerRepresentation(derRepresentation: Array<number>): P384_KeyAgreement_PublicKey
Swift declaration
init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8

Creates a P-384 public key for key agreement from a Distinguished Encoding Rules (DER) encoded representation. - Parameters: - derRepresentation: A DER-encoded representation of the key.

init · iOS 14.0+

init

TypeScript
static initPemRepresentation(pemRepresentation: string): P384_KeyAgreement_PublicKey
Swift declaration
init(pemRepresentation: String) throws

Creates a P-384 public key for key agreement from a Privacy-Enhanced Mail (PEM) representation. - Parameters: - pemRepresentation: A PEM representation of the key.

get · iOS 14.0+

pemRepresentation

TypeScript
get pemRepresentation(): string
Swift declaration
var pemRepresentation: String { get }

A Privacy-Enhanced Mail (PEM) representation of the public key.

get · iOS 13.0+

rawRepresentation

TypeScript
get rawRepresentation(): ArrayBuffer
Swift declaration
var rawRepresentation: Data { get }

A full representation of the public key.

init · iOS 13.0+

init

TypeScript
static initRawRepresentation(rawRepresentation: ArrayBuffer): P384_KeyAgreement_PublicKey
Swift declaration
init<D>(rawRepresentation: D) throws where D : ContiguousBytes

Creates a P-384 public key for key agreement from a collection of bytes. - Parameters: - rawRepresentation: A raw representation of the key as a collection of contiguous bytes.

method · iOS 17.0+

hpkeRepresentation

TypeScript
hpkeRepresentation(kem: HPKE_KEM): ArrayBuffer
Swift declaration
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data

Creates a serialized representation of the public key. - Parameters: - kem: The Key Encapsulation Mechanism to use with the public key. - Returns: The serialized representation of the public key. - Throws: ``CryptoKit/HPKE/Errors/inconsistentCiphersuiteAndKey`` if the key encapsulation mechanism requested is incompatible with this public key.

get · iOS 13.0+

x963Representation

TypeScript
get x963Representation(): ArrayBuffer
Swift declaration
var x963Representation: Data { get }

An ANSI x9.63 representation of the public key.

init · iOS 13.0+

init

TypeScript
static initX963Representation(x963Representation: ArrayBuffer): P384_KeyAgreement_PublicKey
Swift declaration
init<Bytes>(x963Representation: Bytes) throws where Bytes : ContiguousBytes

Creates a P-384 public key for key agreement from an ANSI x9.63 representation. - Parameters: - x963Representation: An ANSI x9.63 representation of the key.

get · iOS 13.0+

compactRepresentation

TypeScript
get compactRepresentation(): (ArrayBuffer) | null
Swift declaration
var compactRepresentation: Data? { get }

A compact representation of the public key.

init · iOS 13.0+

init

TypeScript
static initCompactRepresentation(compactRepresentation: ArrayBuffer): P384_KeyAgreement_PublicKey
Swift declaration
init<Bytes>(compactRepresentation: Bytes) throws where Bytes : ContiguousBytes

Creates a P-384 public key for key agreement from a compact representation of the key. - Parameters: - compactRepresentation: A compact representation of the key as a collection of contiguous bytes.

get · iOS 16.0+

compressedRepresentation

TypeScript
get compressedRepresentation(): ArrayBuffer
Swift declaration
var compressedRepresentation: Data { get }

A compressed representation of the public key.

init · iOS 16.0+

init

TypeScript
static initCompressedRepresentation(compressedRepresentation: ArrayBuffer): P384_KeyAgreement_PublicKey
Swift declaration
init<Bytes>(compressedRepresentation: Bytes) throws where Bytes : ContiguousBytes

Creates a P-384 public key for key agreement from a compressed representation of the key. - Parameters: - compressedRepresentation: A compressed representation of the key as a collection of contiguous bytes.

init · iOS 17.0+

init

TypeScript
static initKem(serialization: ArrayBuffer, kem: HPKE_KEM): P384_KeyAgreement_PublicKey
Swift declaration
init<D>(_ serialization: D, kem: HPKE.KEM) throws where D : ContiguousBytes

Creates a NIST P-384 elliptic curve public key for use with Diffie-Hellman key exchange. - Parameters: - serialization: The serialized bytes of the public key. - kem: The Key Encapsulation Mechanism to use with the public key. - Throws: ``CryptoKit/HPKE/Errors/inconsistentCiphersuiteAndKey`` if the key encapsulation mechanism requested is incompatible with this public key.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →