Skip to content

Commit

Permalink
refactor: use base64 for serialization / deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek committed Jan 16, 2025
1 parent ea02d5a commit 28504f3
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 123 deletions.
2 changes: 2 additions & 0 deletions dist/base64.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare function stringToBase64(str: string): string;
export declare function base64ToString(base64: string): string;
4 changes: 4 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { KeyPairOptions, MaybeSerializedKey, Secret, SerializedKeyPair, WrappedCryptoKeyPair, WrappedKeyData } from './common';
export declare const changePassphrase: (privateKey: MaybeSerializedKey, oldPassphrase: string | null, newPassphrase: string | null) => Promise<WrappedKeyData>;
export declare const generateKeyPair: (options?: KeyPairOptions) => Promise<WrappedCryptoKeyPair>;
export declare const serializeKey: (key: WrappedKeyData) => string;
export declare const unserializeKey: (serialized: string) => WrappedKeyData;
export declare const exportKeyPair: (keyPair: WrappedCryptoKeyPair) => Promise<SerializedKeyPair>;
export declare const encrypt: (data: string, publicKey: MaybeSerializedKey) => Promise<Secret>;
export declare const serializeSecret: (secret: Secret) => string;
export declare const unserializeSecret: (serialized: string) => Secret;
export declare const decrypt: (secret: Secret | string, privateKey: MaybeSerializedKey, passphrase?: string) => Promise<string>;
export type { KeyPairOptions, MaybeSerializedKey, Secret, SerializedKeyPair, WrappedCryptoKeyPair, WrappedKeyData, } from './common';
Loading

0 comments on commit 28504f3

Please sign in to comment.