OxL Reference

method ed25519.publicKey

The public key of a 32-byte private key.

Example:

oxl✓ checked in CI
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 | CryptoError

Since. 1.0.0-beta

Parameters

NameType
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

See also