publicKey
TypeScriptget publicKey(): MLDSA87_PublicKeySwift declarationvar publicKey: MLDSA87.PublicKey { get }The associated public key.
struct · iOS 26.0+ · SDK 27.1
struct PrivateKeyThe private key for MLDSA87.
get publicKey(): MLDSA87_PublicKeySwift declarationvar publicKey: MLDSA87.PublicKey { get }The associated public key.
static initSeedRepresentationPublicKey(seedRepresentation: ArrayBuffer, publicKey?: (MLDSA87_PublicKey) | null): MLDSA87_PrivateKeySwift declarationinit<D>(seedRepresentation: D, publicKey: MLDSA87.PublicKey?) throws where D : DataProtocolInitializes a private key from the seed representation. - Parameter seedRepresentation: The seed representation of the private key. This parameter needs to be 32 bytes long. - Parameter publicKey: The public key associated with the secret key. This initializer implements the `ML-DSA.KeyGen_internal` algorithm (Algorithm 16) of FIPS 204. If a public key is provided, a consistency check is performed between it and the derived public key.
get seedRepresentation(): ArrayBufferSwift declarationvar seedRepresentation: Data { get }The seed representation of the private key. The seed representation is 32 bytes long, and is the parameter for the `ML-DSA.KeyGen_internal` algorithm (Algorithm 16) of FIPS 204.
get integrityCheckedRepresentation(): ArrayBufferSwift declarationvar integrityCheckedRepresentation: Data { get }The integrity-checked data representation of the private key. This representation is 64 bytes long, and contains the seed and a hash of the public key.
static initIntegrityCheckedRepresentation(integrityCheckedRepresentation: ArrayBuffer): MLDSA87_PrivateKeySwift declarationinit<D>(integrityCheckedRepresentation: D) throws where D : DataProtocolInitializes a private key from an integrity-checked data representation. - Parameter integrityCheckedRepresentation: The integrity-checked data representation of the private key. The parameter needs to be 64 bytes long, and contain the seed and a hash of the public key.
signatureFor(data: ArrayBuffer): ArrayBufferSwift declarationfunc signature<D>(for data: D) throws -> Data where D : DataProtocolGenerates a MLDSA87 signature. - Parameters: - data: The data to sign. - Returns: The MLDSA87 signature. This method throws if CryptoKit encounters an error producing the signature.
signatureForContext(data: ArrayBuffer, context: ArrayBuffer): ArrayBufferSwift declarationfunc signature<D, C>(for data: D, context: C) throws -> Data where D : DataProtocol, C : DataProtocolGenerates a MLDSA87 signature, with context. - Parameters: - data: The data to sign. - context: Context for the signature. - Returns: The MLDSA87 signature. This method throws if CryptoKit encounters an error producing the signature.
static init(): MLDSA87_PrivateKeySwift declarationinit() throwsCreates a random MLDSA87 private key. This initializer is marked `throws` to support use in generic contexts, but key generation itself doesn't produce errors. When you call this initializer directly on a concrete type, rather than through a generic type parameter, you can safely call `try!` to create the key: ```swift let privateKey = try! MLDSA87.PrivateKey() ```
No declarations were skipped in this snapshot.