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}")
}Вывод
true
pub(api) static fn publicKey(secretKey: &secret<bytes>) -> bytes | CryptoErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
secretKey | &secret<bytes> |
Возвращает
bytes
Ошибки
CryptoError@error- `CryptoError` when the private key is not 32 bytes.
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/crypto/crypto.oxl:614