@vanaheimr/cose 0.9.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.
- package/CHANGELOG.md +81 -0
- package/LICENSE.md +201 -0
- package/NOTICE +31 -0
- package/README.md +537 -0
- package/dist/aes.d.ts +45 -0
- package/dist/aes.d.ts.map +1 -0
- package/dist/algorithm.d.ts +137 -0
- package/dist/algorithm.d.ts.map +1 -0
- package/dist/asn1.d.ts +114 -0
- package/dist/asn1.d.ts.map +1 -0
- package/dist/cbor.d.ts +65 -0
- package/dist/cbor.d.ts.map +1 -0
- package/dist/curve.d.ts +65 -0
- package/dist/curve.d.ts.map +1 -0
- package/dist/ecdsa.d.ts +56 -0
- package/dist/ecdsa.d.ts.map +1 -0
- package/dist/eddsa.d.ts +14 -0
- package/dist/eddsa.d.ts.map +1 -0
- package/dist/encrypt.d.ts +140 -0
- package/dist/encrypt.d.ts.map +1 -0
- package/dist/errors.d.ts +64 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/headers.d.ts +77 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/hmac.d.ts +32 -0
- package/dist/hmac.d.ts.map +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4159 -0
- package/dist/index.js.map +1 -0
- package/dist/key.d.ts +201 -0
- package/dist/key.d.ts.map +1 -0
- package/dist/labels.d.ts +51 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/mac.d.ts +93 -0
- package/dist/mac.d.ts.map +1 -0
- package/dist/mac0.d.ts +132 -0
- package/dist/mac0.d.ts.map +1 -0
- package/dist/mldsa.d.ts +29 -0
- package/dist/mldsa.d.ts.map +1 -0
- package/dist/payload.d.ts +25 -0
- package/dist/payload.d.ts.map +1 -0
- package/dist/recipient.d.ts +65 -0
- package/dist/recipient.d.ts.map +1 -0
- package/dist/resolve.d.ts +29 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/sign.d.ts +82 -0
- package/dist/sign.d.ts.map +1 -0
- package/dist/sign1.d.ts +273 -0
- package/dist/sign1.d.ts.map +1 -0
- package/dist/signature.d.ts +43 -0
- package/dist/signature.d.ts.map +1 -0
- package/dist/x509.d.ts +144 -0
- package/dist/x509.d.ts.map +1 -0
- package/dist/x5chain.d.ts +98 -0
- package/dist/x5chain.d.ts.map +1 -0
- package/package.json +97 -0
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What goes wrong, and the difference between the two kinds of wrong.
|
|
3
|
+
*
|
|
4
|
+
* A malformed message is a programming or transport error and throws. A
|
|
5
|
+
* signature that does not verify is neither: it is the expected outcome of
|
|
6
|
+
* checking untrusted data, and a library that throws for it invites the
|
|
7
|
+
* `catch {}` that swallows the distinction. Verification therefore returns a
|
|
8
|
+
* result that has to be looked at, and says why when the answer is no.
|
|
9
|
+
*/
|
|
10
|
+
/** A COSE message, key or header bucket that is not well formed. */
|
|
11
|
+
export declare class CoseError extends Error {
|
|
12
|
+
readonly name = "CoseError";
|
|
13
|
+
constructor(message: string, options?: ErrorOptions);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The outcome of a verification.
|
|
17
|
+
*
|
|
18
|
+
* `verified: false` carries a reason, because "it did not verify" is rarely
|
|
19
|
+
* the useful half of the answer — whether the algorithm was refused, the
|
|
20
|
+
* payload was missing or the signature itself was wrong are three very
|
|
21
|
+
* different situations.
|
|
22
|
+
*/
|
|
23
|
+
export type Verification = {
|
|
24
|
+
readonly verified: true;
|
|
25
|
+
} | {
|
|
26
|
+
readonly verified: false;
|
|
27
|
+
readonly reason: string;
|
|
28
|
+
};
|
|
29
|
+
/** A successful verification. */
|
|
30
|
+
export declare const VERIFIED: Verification;
|
|
31
|
+
/**
|
|
32
|
+
* A verification that failed.
|
|
33
|
+
*
|
|
34
|
+
* Named because it is the half of {@link Verification} that carries a reason,
|
|
35
|
+
* and a function returning only this half lets a caller pass it straight on as
|
|
36
|
+
* its own failure without the type widening back to "or it succeeded".
|
|
37
|
+
*/
|
|
38
|
+
export type NotVerified = Extract<Verification, {
|
|
39
|
+
verified: false;
|
|
40
|
+
}>;
|
|
41
|
+
/** A failed verification, with the reason it failed. */
|
|
42
|
+
export declare const notVerified: (reason: string) => NotVerified;
|
|
43
|
+
/**
|
|
44
|
+
* The outcome of a decryption.
|
|
45
|
+
*
|
|
46
|
+
* Kept apart from {@link Verification} because the useful half is different: a
|
|
47
|
+
* verification yields a yes or a no, a decryption yields the plaintext or a
|
|
48
|
+
* reason. Note that there is no partial plaintext in the failure case and
|
|
49
|
+
* never can be — an AEAD failure means the whole message is unauthenticated,
|
|
50
|
+
* and handing back what was decrypted before the tag was checked is the classic
|
|
51
|
+
* way to build an oracle out of a decryptor.
|
|
52
|
+
*/
|
|
53
|
+
export type Decryption = {
|
|
54
|
+
readonly decrypted: true;
|
|
55
|
+
readonly plaintext: Uint8Array;
|
|
56
|
+
} | {
|
|
57
|
+
readonly decrypted: false;
|
|
58
|
+
readonly reason: string;
|
|
59
|
+
};
|
|
60
|
+
/** A failed decryption, with the reason it failed. */
|
|
61
|
+
export declare const notDecrypted: (reason: string) => Extract<Decryption, {
|
|
62
|
+
decrypted: false;
|
|
63
|
+
}>;
|
|
64
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AAGH,oEAAoE;AACpE,qBAAa,SAAU,SAAQ,KAAK;IAEhC,SAAyB,IAAI,eAAe;gBAEzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAI7D;AAGD;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAClB;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAG5D,iCAAiC;AACjC,eAAO,MAAM,QAAQ,EAAE,YAAiC,CAAC;AAGzD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAGrE,wDAAwD;AACxD,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,WACZ,CAAC;AAGlC;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAChB;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAG7D,sDAAsD;AACtD,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,UAAU,EAAE;IAAE,SAAS,EAAE,KAAK,CAAA;CAAE,CACpD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { CoseAlgorithm } from './algorithm.ts';
|
|
2
|
+
import type { CborEntry, CborValue } from './cbor.ts';
|
|
3
|
+
import type { Verification } from './errors.ts';
|
|
4
|
+
export declare class CoseHeaders {
|
|
5
|
+
/** The header parameters, in the order they were given or read. */
|
|
6
|
+
readonly parameters: readonly CborEntry[];
|
|
7
|
+
constructor(parameters?: readonly CborEntry[]);
|
|
8
|
+
/**
|
|
9
|
+
* A bucket without any header parameters. As a protected bucket it is
|
|
10
|
+
* serialized as a zero-length byte string.
|
|
11
|
+
*/
|
|
12
|
+
static readonly empty: CoseHeaders;
|
|
13
|
+
/** How many header parameters this bucket holds. */
|
|
14
|
+
get count(): number;
|
|
15
|
+
/** Whether this bucket has no header parameters at all. */
|
|
16
|
+
get isEmpty(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The bucket holding the two header parameters almost every signed COSE
|
|
19
|
+
* message uses.
|
|
20
|
+
*/
|
|
21
|
+
static create(algorithm?: CoseAlgorithm | null, keyIdentifier?: Uint8Array | null): CoseHeaders;
|
|
22
|
+
/** Parse the given CBOR map as a bucket of header parameters. */
|
|
23
|
+
static parse(value: CborValue): CoseHeaders;
|
|
24
|
+
/**
|
|
25
|
+
* Parse the serialized protected bucket of a COSE message.
|
|
26
|
+
*
|
|
27
|
+
* A zero-length byte string is an empty bucket and *not* an encoded empty
|
|
28
|
+
* map. It is the one encoding that must never be "repaired" into `A0`,
|
|
29
|
+
* because the signature covers these exact bytes [RFC 9052, Section 3].
|
|
30
|
+
*
|
|
31
|
+
* This is deliberately a separate function rather than an overload: a byte
|
|
32
|
+
* array is also a perfectly good CBOR byte string, and the two readings of
|
|
33
|
+
* the same argument mean very different things here.
|
|
34
|
+
*/
|
|
35
|
+
static parseProtected(protectedBytes: Uint8Array): CoseHeaders;
|
|
36
|
+
/** The value of the given header parameter, or null. */
|
|
37
|
+
get(labelValue: CborValue): CborValue | null;
|
|
38
|
+
/** Whether the given header parameter is present within this bucket. */
|
|
39
|
+
has(labelValue: CborValue): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Return a copy in which the given header parameter is set, replacing it
|
|
42
|
+
* in place when it is already present and appending it otherwise.
|
|
43
|
+
*/
|
|
44
|
+
set(labelValue: CborValue, value: CborValue): CoseHeaders;
|
|
45
|
+
/** The cryptographic algorithm (label 1), or null when absent. */
|
|
46
|
+
get algorithm(): CoseAlgorithm | null;
|
|
47
|
+
/** The key identifier (label 4), or null when absent or not a byte string. */
|
|
48
|
+
get keyIdentifier(): Uint8Array | null;
|
|
49
|
+
/** The content type (label 3), or null when absent. */
|
|
50
|
+
get contentType(): CborValue | null;
|
|
51
|
+
/** The labels a recipient is required to understand (label 2), or null. */
|
|
52
|
+
get critical(): readonly CborValue[] | null;
|
|
53
|
+
/** A CBOR map holding these header parameters, in their own order. */
|
|
54
|
+
toCbor(): CborValue;
|
|
55
|
+
/**
|
|
56
|
+
* The serialization of this bucket for use as the PROTECTED bucket of a
|
|
57
|
+
* COSE message: a zero-length byte string when the bucket is empty, and
|
|
58
|
+
* the encoded map otherwise [RFC 9052, Section 3].
|
|
59
|
+
*
|
|
60
|
+
* These are the exact bytes a signature is computed over, so they have to
|
|
61
|
+
* be transmitted and stored verbatim.
|
|
62
|
+
*/
|
|
63
|
+
toProtectedBytes(): Uint8Array;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check the `crit` header parameter of a pair of buckets
|
|
67
|
+
* [RFC 9052, Section 3.1].
|
|
68
|
+
*
|
|
69
|
+
* Every label listed there has to be present within the protected bucket and
|
|
70
|
+
* has to be understood and processed by whoever is verifying, otherwise the
|
|
71
|
+
* whole message is rejected. `alsoUnderstood` is how a caller that genuinely
|
|
72
|
+
* processes a parameter says so — validating a certificate chain, for
|
|
73
|
+
* instance — because what counts as understood is a property of the
|
|
74
|
+
* verification being performed rather than of this library.
|
|
75
|
+
*/
|
|
76
|
+
export declare function verifyCriticalHeaderParameters(protectedHeader: CoseHeaders, unprotectedHeader: CoseHeaders, alsoUnderstood?: readonly CborValue[]): Verification;
|
|
77
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../src/headers.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAwB,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAiB,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAyB,aAAa,CAAC;AAKnE,qBAAa,WAAW;IAEpB,mEAAmE;IACnE,SAAgB,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;gBAG9B,UAAU,GAAE,SAAS,SAAS,EAAO;IAcxD;;;OAGG;IACH,gBAA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
3
|
+
* The full HMAC of a message, before any truncation.
|
|
4
|
+
*
|
|
5
|
+
* The key is passed through as it is. RFC 9053 says the key SHOULD be as long
|
|
6
|
+
* as the hash output, which is a recommendation about key management rather
|
|
7
|
+
* than a rule about the primitive — RFC 2104 accepts any length, and the
|
|
8
|
+
* published test vectors of RFC 4231 include a four-byte key. Refusing short
|
|
9
|
+
* keys here would make those vectors unreproducible while protecting nobody
|
|
10
|
+
* who was not already choosing their own key length.
|
|
11
|
+
*/
|
|
12
|
+
export declare const hmac: (hash: DigestAlgorithm, key: Uint8Array, message: Uint8Array) => Uint8Array;
|
|
13
|
+
/**
|
|
14
|
+
* The authentication tag of a message: the HMAC, truncated to the width the
|
|
15
|
+
* algorithm names.
|
|
16
|
+
*
|
|
17
|
+
* `tagSize` is in bytes and is the algorithm's, never the caller's — the
|
|
18
|
+
* whole point of `HMAC 256/64` being a registered identifier rather than a
|
|
19
|
+
* parameter is that both parties know the width from the message.
|
|
20
|
+
*/
|
|
21
|
+
export declare function macTag(hash: DigestAlgorithm, tagSize: number, key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* Whether two authentication tags are the same, without saying *where* they
|
|
24
|
+
* first differ.
|
|
25
|
+
*
|
|
26
|
+
* The length check in front is not a leak: the width of a tag follows from the
|
|
27
|
+
* algorithm, which travels in the message and is known to everybody. What must
|
|
28
|
+
* not leak is the position of the first differing byte, and that is what the
|
|
29
|
+
* constant-time comparison protects.
|
|
30
|
+
*/
|
|
31
|
+
export declare function tagsEqual(left: Uint8Array, right: Uint8Array): boolean;
|
|
32
|
+
//# sourceMappingURL=hmac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAO,YAAY,CAAC;AAGnD;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,eAAe,EAAE,KAAK,UAAU,EAAE,SAAS,UAAU,KAAG,UAC1C,CAAC;AAG1C;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAM,eAAe,EACzB,OAAO,EAAG,MAAM,EAChB,GAAG,EAAO,UAAU,EACpB,OAAO,EAAG,UAAU,GAAG,UAAU,CASvD;AAGD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAetE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CBOR Object Signing and Encryption [RFC 9052] in TypeScript.
|
|
3
|
+
*
|
|
4
|
+
* The TypeScript counterpart of Vanaheimr Styx's `Illias/COSE`, built on the
|
|
5
|
+
* same CBOR codec that carries Metrological CBOR — which is the point: the
|
|
6
|
+
* encoding of a metrological reading is a pure function of its value, unit,
|
|
7
|
+
* prefix and uncertainty, so the same reading always produces the same bytes
|
|
8
|
+
* and therefore the same signature. Two implementations that disagree about
|
|
9
|
+
* one byte of a reading produce signatures that fail at the other, and that is
|
|
10
|
+
* a conformance failure a test can catch.
|
|
11
|
+
*
|
|
12
|
+
* What is implemented: `COSE_Sign1` (tag 18) and `COSE_Sign` (tag 98);
|
|
13
|
+
* `COSE_Mac0` (tag 17) and `COSE_Mac` (tag 97) with HMAC; `COSE_Encrypt0`
|
|
14
|
+
* (tag 16) and `COSE_Encrypt` (tag 96) with AES-GCM; recipient structures
|
|
15
|
+
* carrying a content key by `direct` or AES key wrap; the version 2
|
|
16
|
+
* countersignatures of RFC 9338; COSE keys of key type EC2, OKP, AKP and
|
|
17
|
+
* Symmetric with the key thumbprints of RFC 9679; the ECDSA algorithms of
|
|
18
|
+
* RFC 9053 and RFC 9864, EdDSA of RFC 8032 and ML-DSA of RFC 9964; and the
|
|
19
|
+
* X.509 chains of RFC 9360, walked to a trust anchor and bound to the key that
|
|
20
|
+
* signed. Detached payloads, external additional authenticated data and the
|
|
21
|
+
* `crit` header parameter throughout.
|
|
22
|
+
*
|
|
23
|
+
* The three families mean three different things, and the API keeps them
|
|
24
|
+
* apart. A **signature** says "the holder of that private key produced this",
|
|
25
|
+
* to anybody. A **MAC** says "someone holding the shared key produced this",
|
|
26
|
+
* and only to someone holding that key — so it proves nothing to a third
|
|
27
|
+
* party, and with several recipients nothing to the recipients either.
|
|
28
|
+
* **Encryption** says even less about origin: AEAD integrity means "whoever
|
|
29
|
+
* holds this key wrote this". That is why a metrological record is *signed*,
|
|
30
|
+
* and why a signed payload inside an encrypted envelope is how one gets both.
|
|
31
|
+
* `signWith` and `macWith` refuse each other's algorithms accordingly.
|
|
32
|
+
*
|
|
33
|
+
* What is not, each for a reason. AES-CBC-MAC, whose safety within COSE rests
|
|
34
|
+
* on the encoding rather than on the primitive, see RFC 9053 Section 3.2.1.
|
|
35
|
+
* AES-CCM and ChaCha20/Poly1305, as scope rather than judgement: CCM is eight
|
|
36
|
+
* registered variants of nonce and tag width for a constrained-device world
|
|
37
|
+
* this library does not live in — and, since the crypto moved to noble, a
|
|
38
|
+
* primitive without a supplier — while ChaCha earns its keep where there is
|
|
39
|
+
* no AES hardware; Styx carries neither, so the cross-signing suite would
|
|
40
|
+
* have nothing to compare. `COSE_Countersignature0`, a bare signature with no
|
|
41
|
+
* header buckets of its own: which algorithm made it and which key checks it
|
|
42
|
+
* travel outside the message, by agreement, and everything else here works in
|
|
43
|
+
* the opposite direction. ECDH-based key agreement and the HKDF key
|
|
44
|
+
* derivations, which need COSE_KDF_Context, a structure of its own. And the
|
|
45
|
+
* `x5bag` and `x5u` header parameters: a bag is an unordered heap with no
|
|
46
|
+
* path to follow, and a URI is a fetch, which a signature library has no
|
|
47
|
+
* business performing.
|
|
48
|
+
*/
|
|
49
|
+
export { CoseError, notDecrypted, notVerified, VERIFIED } from './errors.ts';
|
|
50
|
+
export type { Decryption, NotVerified, Verification } from './errors.ts';
|
|
51
|
+
export { bytesEqual, cbor, DETERMINISTIC, NO_BYTES, PRESERVE } from './cbor.ts';
|
|
52
|
+
export { canonicalizePayload, isCanonicalPayload } from './payload.ts';
|
|
53
|
+
export type { CborEntry, CborValue } from './cbor.ts';
|
|
54
|
+
export { HeaderLabel, headerLabelName, isUnderstood, label, sameLabel } from './labels.ts';
|
|
55
|
+
export { ALL_CURVES, CoseCurves, curveById, curveByName, KEY_TYPE_EC2, KEY_TYPE_OKP } from './curve.ts';
|
|
56
|
+
export type { CoseCurve } from './curve.ts';
|
|
57
|
+
export { ALL_ALGORITHMS, algorithmById, algorithmByName, algorithmFromCbor, algorithmToCbor, CoseAlgorithms, macWith, resolveCurve, sameAlgorithm, signWith, verifyMacWith, verifyWith } from './algorithm.ts';
|
|
58
|
+
export type { AlgorithmFamily, CoseAlgorithm } from './algorithm.ts';
|
|
59
|
+
export { decompressY, digest, isImplemented, isOnCurve, publicKeyFor } from './ecdsa.ts';
|
|
60
|
+
export type { DigestAlgorithm } from './ecdsa.ts';
|
|
61
|
+
export { eddsaPublicKeyFor, eddsaSign, eddsaSignatureSize, eddsaVerify, isEddsaCurve } from './eddsa.ts';
|
|
62
|
+
export { isMldsaParameterSet, MLDSA_PARAMETER_SETS, MLDSA_SEED_SIZE, MLDSA_SIZES, mldsaPublicKeyFor, mldsaSign, mldsaVerify } from './mldsa.ts';
|
|
63
|
+
export type { MldsaParameterSet } from './mldsa.ts';
|
|
64
|
+
export { CoseHeaders, verifyCriticalHeaderParameters } from './headers.ts';
|
|
65
|
+
export { CoseKey, KEY_TYPE_AKP, KEY_TYPE_SYMMETRIC, KeyLabel } from './key.ts';
|
|
66
|
+
export type { CoseKeyParts } from './key.ts';
|
|
67
|
+
export { CoseSignature } from './signature.ts';
|
|
68
|
+
export { COSE_SIGN1_TAG, COUNTERSIGNATURE_CONTEXT, CoseSign1, SIGNATURE_CONTEXT } from './sign1.ts';
|
|
69
|
+
export type { CertificateChainVerification, CertificateChainVerifyOptions, Sign1Options, VerifyOptions } from './sign1.ts';
|
|
70
|
+
export { COSE_SIGN_TAG, CoseSign } from './sign.ts';
|
|
71
|
+
export { COSE_MAC0_TAG, CoseMac0, MAC0_CONTEXT } from './mac0.ts';
|
|
72
|
+
export type { Mac0Options, Mac0VerifyOptions } from './mac0.ts';
|
|
73
|
+
export { hmac, macTag, tagsEqual } from './hmac.ts';
|
|
74
|
+
export { aesGcmDecrypt, aesGcmEncrypt, aesKeyUnwrap, aesKeyWrap, GCM_NONCE_SIZE, GCM_TAG_SIZE } from './aes.ts';
|
|
75
|
+
export { CoseRecipient, keyWrapAlgorithmFor } from './recipient.ts';
|
|
76
|
+
export type { RecipientOptions } from './recipient.ts';
|
|
77
|
+
export { COSE_MAC_TAG, CoseMac, MAC_CONTEXT } from './mac.ts';
|
|
78
|
+
export type { MacOptions, MacVerifyOptions } from './mac.ts';
|
|
79
|
+
export { COSE_ENCRYPT0_TAG, COSE_ENCRYPT_TAG, CoseEncrypt, CoseEncrypt0, encStructure, ENCRYPT0_CONTEXT, ENCRYPT_CONTEXT } from './encrypt.ts';
|
|
80
|
+
export type { DecryptOptions, EncryptOptions } from './encrypt.ts';
|
|
81
|
+
export { contentsOf, contextTag, derBitString, derBitStringRaw, derBoolean, derInteger, derObjectIdentifier, derString, derTime, DerReader, Tag } from './asn1.ts';
|
|
82
|
+
export type { Asn1Node } from './asn1.ts';
|
|
83
|
+
export { curveByOid, KeyUsage, oidOfCurve, signatureAlgorithmByOid, X509Certificate, X509Name } from './x509.ts';
|
|
84
|
+
export type { BasicConstraints, NameAttribute } from './x509.ts';
|
|
85
|
+
export { CoseCertificateChain, CoseCertificateHash } from './x5chain.ts';
|
|
86
|
+
export type { ChainValidationOptions } from './x5chain.ts';
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;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