class PrivateSecp256r1

Private Secp256r1 key.

Constructors

new
PrivateSecp256r1()

Methods

addAESRecipient(
verification_method: DIDURL,
jwe: JWE,
recipient: PublicSecp256r1,
): JWERecipient
addChaCha20Recipient(
verification_method: DIDURL,
jwe: JWE,
recipient: PublicSecp256r1,
): JWERecipient
decryptAES(
verification_method: DIDURL,
jwe: JWE,
): Uint8Array

Decrypt the provided JWE object using the X25519 key and the A256GCM algorithm.

decryptChaCha20(
verification_method: DIDURL,
jwe: JWE,
): Uint8Array

Decrypt the provided JWE object using the X25519 key and the XC20P algorithm.

free(): void
issueVC(
verification_method: DIDURL,
vc: object,
context_loader: ContextLoader,
options?: W3CIssueOptions | null,
): Promise<object>

Create a new verifiable credential.

presentVP(
verification_method: DIDURL,
vp: object,
context_loader: ContextLoader,
domain?: string | null,
challenge?: string | null,
options?: W3CPresentOptions | null,
): Promise<object>

Create a new verifiable presentation.

signJWS(
payload: string,
options?: JWSOptions | null,
): string

Sign the provided payload using the Secp256r1 key.

toBytes(): Uint8Array

Get Secp256r1 private key bytes.

Get the did:key document DID value of the Secp256r1 key.

Get the did:key DID URL fragment value of the Secp256r1 key.

Get the JWK value (with the private key) of the Secp256r1 key.

Get the JWK value (without the private key) of the Secp256r1 key.

Derive a Secp256r1 public key from the private key.

Static Methods

fromBytes(value: Uint8Array): PrivateSecp256r1

Convert private key bytes into a public/private Secp256r1 keypair.

Convert private key PKCS#8 PEM value into a public/private Secp256r1 keypair.

Create a new random keypair.