Crypto
The crypto manager exposes the cryptographic primitives the SDK uses for ephemeral key registration and for signing lock operations. All key pairs are Ed25519.
Each platform uses its own crypto provider and its own native key encoding:
| Platform | Provider |
|---|---|
| JVM | Java Security API |
| Android | Bouncy Castle |
| iOS / macOS / watchOS | Apple CryptoKit |
| JS / Browser / Node | Libsodium |
| C# / Python | Libsodium |
Generate a key pair
Generates a brand-new Ed25519 key pair. The key pair is not stored automatically.
- Kotlin
- Java
- Swift
- JavaScript
- C#
- Python
// Returns a KeyPair
val keyPair = sdk.crypto().generateKeyPair()
// Returns a KeyPair
var keyPair = sdk.crypto().generateKeyPair();
// Returns a Crypto.KeyPair
let keyPair = sdk.crypto().generateKeyPair()
// Returns a Crypto.KeyPair
const crypto = doordeck.com.doordeck.multiplatform.sdk.crypto.crypto();
const keyPair = crypto.generateKeyPair();
// Returns a KeyPair
var keyPair = sdk.GetCryptoManager().GenerateKeyPair();
# Returns a SimpleNamespace
keyPair = sdk.cryptoManager.generate_key_pair()