One Logo Pool Ball
CryptoKit · IOS API REFERENCE

Curve25519.KeyAgreement.PrivateKey

struct · iOS 13.0+ · SDK 27.1

struct PrivateKey

A Curve25519 private key used for key agreement.

Members (5)

method · iOS 13.0+

sharedSecretFromKeyAgreement

TypeScript
sharedSecretFromKeyAgreement(publicKeyShare: Curve25519_KeyAgreement_PublicKey): SharedSecret
Swift declaration
func sharedSecretFromKeyAgreement(with publicKeyShare: Curve25519.KeyAgreement.PublicKey) throws -> SharedSecret

Computes a shared secret with the provided public key from another party. - Parameters: - publicKeyShare: The public key from another party to be combined with the private key from this user to create the shared secret. - Returns: The computed shared secret.

get · iOS 13.0+

publicKey

TypeScript
get publicKey(): Curve25519_KeyAgreement_PublicKey
Swift declaration
var publicKey: Curve25519.KeyAgreement.PublicKey { get }

The corresponding public key.

get · iOS 13.0+

rawRepresentation

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

The raw representation of the key as a collection of contiguous bytes.

init · iOS 13.0+

init

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

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

init · iOS 13.0+

init

TypeScript
static init(): Curve25519_KeyAgreement_PrivateKey
Swift declaration
init()

Creates a random Curve25519 private key for key agreement.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →