method ed25519.publicKey
The public key of a 32-byte private key.
Example:
use std.crypto { ed25519 }
fn main() io, rand {
let kp = ed25519.generate()
print("{ed25519.publicKey(&kp.secretKey)! == kp.publicKey}")
}Output
true
pub(api) static fn publicKey(secretKey: &secret<bytes>) -> bytes | CryptoErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
secretKey | &secret<bytes> |
Returns
bytes
Errors
CryptoError@error- `CryptoError` when the private key is not 32 bytes.
Effects
none declared (pure unless the body says otherwise)
Defined in: std/crypto/crypto.oxl:614