Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/crypto/crypto-types.ts>ICrypto

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
interface ICrypto
import { type ICrypto } from "https://deno.land/x/earthstar@v10.0.0-beta.5/src/crypto/crypto-types.ts";

Higher-level crypto functions. Not used directly for the most part, but useful for generating new keypairs.

Methods

sha256base32(input: string | Uint8Array): Promise<Base32String>
updatableSha256(): UpdatableHash<any>
generateAuthorKeypair(name: string): Promise<AuthorKeypair | ValidationError>
generateShareKeypair(name: string): Promise<ShareKeypair | ValidationError>
sign(keypair: AuthorKeypair | ShareKeypair, msg: string | Uint8Array): Promise<Base32String | ValidationError>
verify(
msg: string | Uint8Array,
): Promise<boolean>
checkKeypairIsValid(keypair: AuthorKeypair | ShareKeypair): Promise<true | ValidationError>