Skip to main content
Module

x/earthstar/src/entries/universal.ts>ICrypto

Storage for private, distributed, offline-first applications.
Go to Latest
interface ICrypto
Re-export
import { type ICrypto } from "https://deno.land/x/earthstar@v10.0.2/src/entries/universal.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>