Initializerswift-crypto 3.12.2Crypto
init
Creates a random Curve25519 private key for key agreement.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
init()
Creates a random Curve25519 private key for key agreement.
init()
import Crypto
A cryptography library for Swift.
struct PrivateKey
A Curve25519 private key used for key agreement.
enum Curve25519
An elliptic curve that enables X25519 key agreement and Ed25519 signatures.
enum KeyAgreement
A mechanism used to create a shared secret between two users by performing X25519 key agreement.
init<D>(rawRepresentation: D) throws where D : ContiguousBytes
Creates a Curve25519 private key for key agreement from a collection of bytes.
var publicKey: Curve25519.KeyAgreement.PublicKey { get }
The corresponding public key.
var rawRepresentation: Data { get }
The raw representation of the key as a collection of contiguous bytes.
func sharedSecretFromKeyAgreement(with publicKeyShare: Curve25519.KeyAgreement.PublicKey) throws -> SharedSecret
Computes a shared secret with the provided public key from another party.