publicKey
TypeScriptget publicKey(): MLKEM768_PublicKeySwift declarationvar publicKey: MLKEM768.PublicKey { get }The corresponding public key.
struct · iOS 26.0+ · SDK 27.1
struct PrivateKeyA private key you use to decapsulate shared secrets with the Module-Lattice key encapsulation mechanism.
get publicKey(): MLKEM768_PublicKeySwift declarationvar publicKey: MLKEM768.PublicKey { get }The corresponding public key.
decapsulate(encapsulated: ArrayBuffer): SymmetricKeySwift declarationfunc decapsulate<D>(_ encapsulated: D) throws -> SymmetricKey where D : DataProtocolDecapsulate a shared secret. - Parameters: - encapsulated: An encapsulated shared secret, that you get by calling ``MLKEM768/PublicKey/encapsulate()`` on the corresponding public key. - Returns: The shared secret.
static initSeedRepresentationPublicKey(seedRepresentation: ArrayBuffer, publicKey?: (MLKEM768_PublicKey) | null): MLKEM768_PrivateKeySwift declarationinit<D>(seedRepresentation: D, publicKey: MLKEM768.PublicKey?) throws where D : DataProtocolInitializes a private key from a seed representation and optional public key. - Parameters: - seedRepresentation: The seed representation `d||z`, as specified in the `ML-KEM.KeyGen_internal(d,z)` algorithm (Algorithm 16) of FIPS 203. - publicKey: An optional public key. Pass this to check that the initialized private key is consistent with the public key. The initializer throws if the public key doesn't match the expected value.
get seedRepresentation(): ArrayBufferSwift declarationvar seedRepresentation: Data { get }The private key's seed representation. The seed is `d||z`, as specified in the algorithm `ML-KEM.KeyGen_internal(d,z)` (Algorithm 16) of FIPS 203.
get integrityCheckedRepresentation(): ArrayBufferSwift declarationvar integrityCheckedRepresentation: Data { get }An integrity-checked representation of the private key. This representation includes the seed value, and a hash of the corresponding public key.
static initIntegrityCheckedRepresentation(integrityCheckedRepresentation: ArrayBuffer): MLKEM768_PrivateKeySwift declarationinit<D>(integrityCheckedRepresentation: D) throws where D : DataProtocolInitializes a private key from an integrity-checked representation. - Parameter integrityCheckedRepresentation: A representation of the private key that includes the seed value, and a hash of the corresponding public key.
static generate(): MLKEM768_PrivateKeySwift declarationstatic func generate() throws -> MLKEM768.PrivateKeyGenerates a new, random private key.
static init(): MLKEM768_PrivateKeySwift declarationinit() throwsInitializes a random private key.
No declarations were skipped in this snapshot.