UNPKG

web-identity-schemas

Version:

TypeScript types and validation schemas for Web Identity and JOSE standards, including:

127 lines (125 loc) 5.86 kB
import { LegacyVerificationMethodType, VerificationMethodType } from "./index-COqIpwoL.js"; //#region src/constants/algorithms.d.ts /** * Shared algorithm constants for JOSE specifications. * These can be used across different validation libraries (valibot, zod, etc.) */ /** * JSON Web Signature algorithms that require cryptographic signatures. * @see {@link https://datatracker.ietf.org/doc/html/rfc7518} */ declare const joseSignatureAlgorithms: readonly ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES256K", "ES384", "ES512", "PS256", "PS384", "PS512", "EdDSA"]; /** * Algorithm for Unsecured JWS/JWT. * @see {@link https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.1} */ declare const joseUnsecuredAlgorithm: "none"; /** * All JOSE signature algorithms including unsecured. */ declare const joseAlgorithms: readonly ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES256K", "ES384", "ES512", "PS256", "PS384", "PS512", "EdDSA", "none"]; /** * JSON Web Encryption Content Encryption Algorithms. * @see {@link https://datatracker.ietf.org/doc/html/rfc7518#section-5.1} */ declare const jweContentEncryptionAlgorithms: readonly ["A128GCM", "A192GCM", "A256GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"]; /** * JSON Web Encryption Key Management Algorithms. * @see {@link https://datatracker.ietf.org/doc/html/rfc7518#section-4.1} */ declare const jweKeyManagementAlgorithms: readonly ["RSA1_5", "RSA-OAEP", "RSA-OAEP-256", "A128KW", "A192KW", "A256KW", "dir", "ECDH-ES", "ECDH-ES+A128KW", "ECDH-ES+A192KW", "ECDH-ES+A256KW", "A128GCMKW", "A192GCMKW", "A256GCMKW", "PBES2-HS256+A128KW", "PBES2-HS384+A192KW", "PBES2-HS512+A256KW"]; /** * JSON Web Signature and Encryption Compression Algorithms. * @see {@link https://datatracker.ietf.org/doc/html/rfc7518#section-7.3} */ declare const joseCompressionAlgorithms: readonly ["DEF"]; //#endregion //#region src/constants/curves.d.ts /** * Shared cryptographic curve constants. * These can be used across different validation libraries (valibot, zod, etc.) */ /** * Elliptic curves for Elliptic Curve Digital Signature Algorithm (ECDSA). * @see {@link https://datatracker.ietf.org/doc/html/rfc7518#section-6.2.1.1} */ declare const ellipticCurves: readonly ["P-256", "secp256r1", "P-256K", "secp256k1", "P-384", "P-521"]; /** * Octet string key pairs curves for EdDSA and ECDH. * @see {@link https://datatracker.ietf.org/doc/html/rfc8037#section-2} */ declare const octetKeyPairCurves: readonly ["Ed25519", "Ed448", "X25519", "X448"]; /** * All supported cryptographic curves. */ declare const cryptographicCurves: readonly ["P-256", "secp256r1", "P-256K", "secp256k1", "P-384", "P-521", "Ed25519", "Ed448", "X25519", "X448"]; //#endregion //#region src/constants/did.d.ts declare const legacyVerificationMethodTypes: LegacyVerificationMethodType[]; declare const verificationMethodTypes: VerificationMethodType[]; declare const didRegex: RegExp; declare const didUrlRegex: RegExp; declare const didMethodRegex: RegExp; //#endregion //#region src/constants/jwk.d.ts /** * Shared JSON Web Key constants. * These can be used across different validation libraries (valibot, zod, etc.) */ /** * Key types for JSON Web Keys. * @see {@link https://datatracker.ietf.org/doc/html/rfc7517#section-4.1} */ declare const keyTypes: readonly ["RSA", "EC", "oct", "OKP"]; /** * Public key uses for JSON Web Keys. * @see {@link https://datatracker.ietf.org/doc/html/rfc7517#section-4.2} */ declare const keyUses: readonly ["sig", "enc"]; /** * Key operations for JSON Web Keys. * @see {@link https://datatracker.ietf.org/doc/html/rfc7517#section-4.3} */ declare const keyOperations: readonly ["sign", "verify", "encrypt", "decrypt", "wrapKey", "unwrapKey", "deriveKey", "deriveBits"]; //#endregion //#region src/constants/vc.d.ts /** * Shared Verifiable Credentials context constants. * These can be used across different validation libraries (valibot, zod, etc.) */ /** * Core VC Data Model V1 context. * @see {@link https://www.w3.org/TR/vc-data-model/#contexts} */ declare const vcV1CoreContext: "https://www.w3.org/2018/credentials/v1"; /** * Core VC Data Model V2 context. * @see {@link https://www.w3.org/TR/vc-data-model/#contexts} */ declare const vcV2CoreContext: "https://www.w3.org/ns/credentials/v2"; /** * StatusList2021 context (for V1 credentials). * @see {@link https://w3c.github.io/vc-status-list-2021/} */ declare const statusList2021Context: "https://w3id.org/vc/status-list/2021/v1"; /** * BitstringStatusList context (for V2 credentials). * @see {@link https://www.w3.org/TR/vc-bitstring-status-list/} */ declare const bitstringStatusListContext: "https://www.w3.org/ns/credentials/status/v1"; /** * Proof purposes for VCs and VPs. * @see {@link https://www.w3.org/TR/vc-data-model/#proofs-signatures} */ declare const proofPurposes: readonly ["assertionMethod", "authentication", "keyAgreement", "capabilityInvocation", "capabilityDelegation"]; /** * Credential status types. * @see {@link https://www.w3.org/TR/vc-data-model/#status} */ declare const credentialStatusTypes: readonly ["RevocationList2020Status", "StatusList2021Entry", "BitstringStatusListEntry"]; /** * Status purposes for credential status. */ declare const statusPurposes: readonly ["revocation", "suspension"]; //#endregion export { bitstringStatusListContext, credentialStatusTypes, cryptographicCurves, didMethodRegex, didRegex, didUrlRegex, ellipticCurves, joseAlgorithms, joseCompressionAlgorithms, joseSignatureAlgorithms, joseUnsecuredAlgorithm, jweContentEncryptionAlgorithms, jweKeyManagementAlgorithms, keyOperations, keyTypes, keyUses, legacyVerificationMethodTypes, octetKeyPairCurves, proofPurposes, statusList2021Context, statusPurposes, vcV1CoreContext, vcV2CoreContext, verificationMethodTypes };