One Logo Pool Ball
CryptoKit · IOS API REFERENCE

SecureEnclave.P256.KeyAgreement.PrivateKey

struct · iOS 13.0+ · SDK 27.1

struct PrivateKey

A P-256 private key used for key agreement.

Members (5)

method · iOS 13.0+

sharedSecretFromKeyAgreement

TypeScript
sharedSecretFromKeyAgreement(publicKeyShare: P256_KeyAgreement_PublicKey): SharedSecret
Swift declaration
func sharedSecretFromKeyAgreement(with publicKeyShare: P256.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(): P256_KeyAgreement_PublicKey
Swift declaration
let publicKey: P256.KeyAgreement.PublicKey

The corresponding public key.

get · iOS 13.0+

dataRepresentation

TypeScript
get dataRepresentation(): ArrayBuffer
Swift declaration
let dataRepresentation: Data

A data representation of the private key.

init · iOS 13.0+

init

TypeScript
static initDataRepresentationAuthenticationContext(dataRepresentation: ArrayBuffer, authenticationContext?: (_LocalAuthentication_LAContext) | null): SecureEnclave_P256_KeyAgreement_PrivateKey
Swift declaration
init(dataRepresentation: Data, authenticationContext: LAContext? = nil) throws

Creates a P-256 private key for key agreement from a data representation of the key with the given authentication context. - Parameters: - dataRepresentation: A data representation of the key. - authenticationContext: A local authentication context.

init · iOS 13.0+

init

TypeScript
static initCompactRepresentableAccessControlAuthenticationContext(compactRepresentable?: boolean, accessControl?: _Security_SecAccessControl, authenticationContext?: (_LocalAuthentication_LAContext) | null): SecureEnclave_P256_KeyAgreement_PrivateKey
Swift declaration
init(compactRepresentable: Bool = true, accessControl: SecAccessControl = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, [], nil)!, authenticationContext: LAContext? = nil) throws

Creates a P-256 private key for key agreement with the specified access control. - Parameters: - compactRepresentable: A Boolean value that indicates whether CryptoKit creates the key with the structure to enable compact point encoding. - accessControl: The protection type and flags to use when creating the associated access control object. - authenticationContext: A local authentication context.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →