Readonly
codeMulticodec code that corresponds to Ed private key.
Readonly
signatureName of the signature algorithm. It is a human readable equivalent of
the signatureCode, however it is also used as last segment in
Nonstandard Signatures, which is used as an alg
field of JWT header
when UCANs are serialized to JWT.
Integer corresponding to the byteprefix of the Crypto.SigAlg. It is used to tag signature so it can self describe what algorithm was used.
Readonly
signerThe signer
field is a self reference (usually a getter). It's sole
purpose is to allow splitting signer and verifier through destructuring.
import * as Principal from "@ucanto/principal"
const { signer, verifier } = Principal.from(archive)
Readonly
verifierThe verifier
field just like the signer
exists to allow splitting
them apart through destructuring.
Encodes keypair into bytes.
Source data before it was byte encoding into payload.
Takes byte encoded payload and produces a verifiable signature.
Overrides method to make it more concrete allowing one to use keys
without checking if it's a CryptoKey
or bytes.
Wraps key of this signer into a signer with a different DID. This is primarily used to wrap SignerKey into a Signer that has did of different method.
import { ed25519 } from "@ucanto/principal"
const demo = async () => {
const key = await ed25519.generate()
key.did() // 'did:key:z6Mkqa4oY9Z5Pf5tUcjLHLUsDjKwMC95HGXdE1j22jkbhz6r'
const gozala = key.withDID('did:web:gozala.io')
gozala.did() // 'did:web:gozala.io'
}
Generated using TypeDoc
This interface parametrizes SignerKey and extends it with Ed specific details.