@atproto/aws 0.0.1-beta.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ export declare class AesKey {
2
+ private key;
3
+ constructor(key: CryptoKey);
4
+ static create(): Promise<AesKey>;
5
+ encrypt(data: string): Promise<string>;
6
+ decrypt(data: string): Promise<string>;
7
+ }
8
+ export default AesKey;
@@ -0,0 +1,5 @@
1
+ export declare const P256_DID_PREFIX: Uint8Array;
2
+ export declare const SECP256K1_DID_PREFIX: Uint8Array;
3
+ export declare const BASE58_DID_PREFIX = "did:key:z";
4
+ export declare const P256_JWT_ALG = "ES256";
5
+ export declare const SECP256K1_JWT_ALG = "ES256K";
@@ -0,0 +1,7 @@
1
+ export declare const DID_KEY_BASE58_PREFIX = "did:key:z";
2
+ export declare type ParsedDidKey = {
3
+ jwtAlg: string;
4
+ keyBytes: Uint8Array;
5
+ };
6
+ export declare const parseDidKey: (did: string) => ParsedDidKey;
7
+ export declare const formatDidKey: (jwtAlg: string, keyBytes: Uint8Array) => string;
@@ -0,0 +1 @@
1
+ export declare const multibaseToBytes: (mb: string) => Uint8Array;
@@ -0,0 +1,11 @@
1
+ import AesKey from '../aes';
2
+ export declare class EcdhKeypair {
3
+ private keypair;
4
+ constructor(keypair: CryptoKeyPair);
5
+ static create(): Promise<EcdhKeypair>;
6
+ did(): Promise<string>;
7
+ deriveSharedKey(otherDid: string): Promise<AesKey>;
8
+ encryptForDid(data: string, otherDid: string): Promise<string>;
9
+ decryptFromDid(data: string, otherDid: string): Promise<string>;
10
+ }
11
+ export default EcdhKeypair;
@@ -0,0 +1,19 @@
1
+ import * as ucan from '@ucans/core';
2
+ export declare type EcdsaKeypairOptions = {
3
+ exportable: boolean;
4
+ };
5
+ export declare class EcdsaKeypair implements ucan.DidableKey {
6
+ jwtAlg: string;
7
+ private publicKey;
8
+ private keypair;
9
+ private exportable;
10
+ constructor(keypair: CryptoKeyPair, publicKey: Uint8Array, exportable: boolean);
11
+ static create(opts?: Partial<EcdsaKeypairOptions>): Promise<EcdsaKeypair>;
12
+ static import(jwk: JsonWebKey, opts?: Partial<EcdsaKeypairOptions>): Promise<EcdsaKeypair>;
13
+ publicKeyBytes(): Uint8Array;
14
+ publicKeyStr(encoding?: ucan.Encodings): string;
15
+ did(): string;
16
+ sign(msg: Uint8Array): Promise<Uint8Array>;
17
+ export(): Promise<JsonWebKey>;
18
+ }
19
+ export default EcdsaKeypair;
@@ -0,0 +1,2 @@
1
+ export declare const compressPubkey: (pubkeyBytes: Uint8Array) => Uint8Array;
2
+ export declare const decompressPubkey: (compressed: Uint8Array) => Uint8Array;
@@ -0,0 +1,19 @@
1
+ import * as ucan from '@ucans/core';
2
+ export declare type EcdsaKeypairOptions = {
3
+ exportable: boolean;
4
+ };
5
+ export declare class EcdsaKeypair implements ucan.DidableKey {
6
+ jwtAlg: string;
7
+ private publicKey;
8
+ private keypair;
9
+ private exportable;
10
+ constructor(keypair: CryptoKeyPair, publicKey: Uint8Array, exportable: boolean);
11
+ static create(opts?: Partial<EcdsaKeypairOptions>): Promise<EcdsaKeypair>;
12
+ static import(jwk: JsonWebKey, opts?: Partial<EcdsaKeypairOptions>): Promise<EcdsaKeypair>;
13
+ publicKeyBytes(): Uint8Array;
14
+ publicKeyStr(encoding?: ucan.Encodings): string;
15
+ did(): string;
16
+ sign(msg: Uint8Array): Promise<Uint8Array>;
17
+ export(): Promise<JsonWebKey>;
18
+ }
19
+ export default EcdsaKeypair;
@@ -0,0 +1,4 @@
1
+ export declare const importKeypairJwk: (jwk: JsonWebKey, exportable?: boolean) => Promise<CryptoKeyPair>;
2
+ export declare const verifyDidSig: (did: string, data: Uint8Array, sig: Uint8Array) => Promise<boolean>;
3
+ export declare const verify: (publicKey: Uint8Array, data: Uint8Array, sig: Uint8Array) => Promise<boolean>;
4
+ export declare const importEcdsaPublicKey: (keyBytes: Uint8Array) => Promise<CryptoKey>;
@@ -0,0 +1,3 @@
1
+ import { DidKeyPlugin } from '@ucans/core';
2
+ export declare const p256Plugin: DidKeyPlugin;
3
+ export default p256Plugin;
@@ -0,0 +1,2 @@
1
+ export declare const plugins: import("@ucans/core").DidKeyPlugin[];
2
+ export default plugins;
@@ -0,0 +1,2 @@
1
+ export declare const randomBytes: (length: number) => Uint8Array;
2
+ export declare const randomIV: () => Uint8Array;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const compressPubkey: (pubkeyBytes: Uint8Array) => Uint8Array;
2
+ export declare const decompressPubkey: (compressed: Uint8Array) => Uint8Array;
@@ -0,0 +1,19 @@
1
+ import * as ucan from '@ucans/core';
2
+ export declare type Secp256k1KeypairOptions = {
3
+ exportable: boolean;
4
+ };
5
+ export declare class Secp256k1Keypair implements ucan.DidableKey {
6
+ private privateKey;
7
+ private exportable;
8
+ jwtAlg: string;
9
+ private publicKey;
10
+ constructor(privateKey: Uint8Array, exportable: boolean);
11
+ static create(opts?: Partial<Secp256k1KeypairOptions>): Promise<Secp256k1Keypair>;
12
+ static import(privKey: Uint8Array | string, opts?: Partial<Secp256k1KeypairOptions>): Promise<Secp256k1Keypair>;
13
+ publicKeyBytes(): Uint8Array;
14
+ publicKeyStr(encoding?: ucan.Encodings): string;
15
+ did(): string;
16
+ sign(msg: Uint8Array): Promise<Uint8Array>;
17
+ export(): Promise<Uint8Array>;
18
+ }
19
+ export default Secp256k1Keypair;
@@ -0,0 +1 @@
1
+ export declare const verifyDidSig: (did: string, data: Uint8Array, sig: Uint8Array) => Promise<boolean>;
@@ -0,0 +1,3 @@
1
+ import { DidKeyPlugin } from '@ucans/core';
2
+ export declare const secp256k1Plugin: DidKeyPlugin;
3
+ export default secp256k1Plugin;
@@ -0,0 +1 @@
1
+ export declare const sha256: (input: Uint8Array | string) => Promise<Uint8Array>;
@@ -0,0 +1 @@
1
+ export declare const verifyDidSig: (did: string, data: Uint8Array, sig: Uint8Array) => Promise<boolean>;