@atproto/crypto 0.0.1
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.
- package/README.md +3 -0
- package/build.js +22 -0
- package/dist/aes.d.ts +8 -0
- package/dist/const.d.ts +5 -0
- package/dist/did.d.ts +7 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +3955 -0
- package/dist/index.js.map +7 -0
- package/dist/multibase.d.ts +1 -0
- package/dist/p256/encoding.d.ts +2 -0
- package/dist/p256/keypair.d.ts +19 -0
- package/dist/p256/operations.d.ts +4 -0
- package/dist/p256/plugin.d.ts +3 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/random.d.ts +4 -0
- package/dist/secp256k1/encoding.d.ts +2 -0
- package/dist/secp256k1/keypair.d.ts +19 -0
- package/dist/secp256k1/operations.d.ts +1 -0
- package/dist/secp256k1/plugin.d.ts +3 -0
- package/dist/sha.d.ts +3 -0
- package/dist/verify.d.ts +1 -0
- package/jest.config.js +6 -0
- package/package.json +29 -0
- package/src/aes.ts +64 -0
- package/src/const.ts +6 -0
- package/src/did.ts +56 -0
- package/src/index.ts +15 -0
- package/src/multibase.ts +26 -0
- package/src/p256/encoding.ts +81 -0
- package/src/p256/keypair.ts +85 -0
- package/src/p256/operations.ts +64 -0
- package/src/p256/plugin.ts +13 -0
- package/src/plugins.ts +6 -0
- package/src/random.ts +19 -0
- package/src/secp256k1/encoding.ts +16 -0
- package/src/secp256k1/keypair.ts +65 -0
- package/src/secp256k1/operations.ts +16 -0
- package/src/secp256k1/plugin.ts +11 -0
- package/src/sha.ts +28 -0
- package/src/verify.ts +15 -0
- package/tests/did.test.ts +95 -0
- package/tests/export.test.ts +50 -0
- package/tests/key-compression.test.ts +69 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +9 -0
- package/update-pkg.js +14 -0
package/README.md
ADDED
package/build.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const pkgJson = require('@npmcli/package-json')
|
|
2
|
+
const { nodeExternalsPlugin } = require('esbuild-node-externals')
|
|
3
|
+
|
|
4
|
+
const buildShallow =
|
|
5
|
+
process.argv.includes('--shallow') || process.env.ATP_BUILD_SHALLOW === 'true'
|
|
6
|
+
|
|
7
|
+
if (process.argv.includes('--update-main-to-dist')) {
|
|
8
|
+
return pkgJson
|
|
9
|
+
.load(__dirname)
|
|
10
|
+
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
|
|
11
|
+
.then((pkg) => pkg.save())
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
require('esbuild').build({
|
|
15
|
+
logLevel: 'info',
|
|
16
|
+
entryPoints: ['src/index.ts'],
|
|
17
|
+
bundle: true,
|
|
18
|
+
sourcemap: true,
|
|
19
|
+
outdir: 'dist',
|
|
20
|
+
platform: 'node',
|
|
21
|
+
plugins: buildShallow ? [nodeExternalsPlugin()] : [],
|
|
22
|
+
})
|
package/dist/aes.d.ts
ADDED
package/dist/const.d.ts
ADDED
package/dist/did.d.ts
ADDED
|
@@ -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;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './aes';
|
|
2
|
+
export * from './const';
|
|
3
|
+
export * from './did';
|
|
4
|
+
export * from './multibase';
|
|
5
|
+
export * from './random';
|
|
6
|
+
export * from './sha';
|
|
7
|
+
export * from './verify';
|
|
8
|
+
export * from './p256/keypair';
|
|
9
|
+
export * from './p256/plugin';
|
|
10
|
+
export * from './secp256k1/keypair';
|
|
11
|
+
export * from './secp256k1/plugin';
|
|
12
|
+
export type { DidableKey } from '@ucans/core';
|