(feat): add first release
This commit is contained in:
parent
fc0a1a982d
commit
2ba049f576
19 changed files with 1819 additions and 0 deletions
18
dist/crypto.d.ts
vendored
Normal file
18
dist/crypto.d.ts
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
type Base64URLString = string;
|
||||
export declare function encrypt(secret: string, plaintext: string): Promise<string>;
|
||||
/**
|
||||
* Decrypts base64 ciphertext with a symmetric key derived from a hex shared secret.
|
||||
* @param secret Hex-encoded shared secret.
|
||||
* @param ciphertext Base64 ciphertext to decrypt.
|
||||
* @returns Decrypted UTF-8 plaintext.
|
||||
*/
|
||||
export declare function decrypt(secret: string, ciphertext: Base64URLString | string): Promise<string>;
|
||||
/**
|
||||
* Computes an X448 shared secret from local and peer key material.
|
||||
* @param ownPrivateKey Local private key in raw/base64/base64url or PKCS#8-wrapped form.
|
||||
* @param ownPublicKey Local public key in raw/base64/base64url or SPKI-wrapped form.
|
||||
* @param otherPublicKey Peer public key in raw/base64/base64url or SPKI-wrapped form.
|
||||
* @returns Hex-encoded shared secret, or a failure message when key material is missing/invalid.
|
||||
*/
|
||||
export declare function getSharedSecret(ownPrivateKey: string, ownPublicKey: string, otherPublicKey: string): Promise<string>;
|
||||
export {};
|
||||
Loading…
Reference in a new issue