@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
134 lines • 4.72 kB
text/typescript
import { KnownJwaSignatureAlgorithm } from "../jwk/jwa.mjs";
import { KmsJwkPublicFromCreateType } from "../jwk/knownJwk.mjs";
import "../jwk/index.mjs";
import { z as z$1 } from "zod";
//#region src/modules/kms/options/KmsCreateKeyOptions.d.ts
declare const zKmsCreateKeyTypeEc: z$1.ZodObject<{
kty: z$1.ZodLiteral<"EC">;
crv: z$1.ZodEnum<{
"P-256": "P-256";
"P-384": "P-384";
"P-521": "P-521";
secp256k1: "secp256k1";
}>;
}, z$1.core.$strip>;
export type KmsCreateKeyTypeEc = z$1.output<typeof zKmsCreateKeyTypeEc>;
/**
* Octer key pair, commonly used for Ed25519 and X25519 key types
*/
declare const zKmsCreateKeyTypeOkp: z$1.ZodObject<{
kty: z$1.ZodLiteral<"OKP">;
crv: z$1.ZodEnum<{
Ed25519: "Ed25519";
X25519: "X25519";
}>;
}, z$1.core.$strip>;
export type KmsCreateKeyTypeOkp = z$1.output<typeof zKmsCreateKeyTypeOkp>;
/**
* RSA key pair.
*/
declare const zKmsCreateKeyTypeRsa: z$1.ZodObject<{
kty: z$1.ZodLiteral<"RSA">;
modulusLength: z$1.ZodUnion<readonly [z$1.ZodLiteral<2048>, z$1.ZodLiteral<3072>, z$1.ZodLiteral<4096>]>;
}, z$1.core.$strip>;
export type KmsCreateKeyTypeRsa = z$1.output<typeof zKmsCreateKeyTypeRsa>;
/**
* Represents an octect sequence for symmetric keys
*/
export declare const zKmsCreateKeyTypeOct: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"aes">;
length: z$1.ZodUnion<readonly [z$1.ZodLiteral<128>, z$1.ZodLiteral<192>, z$1.ZodLiteral<256>, z$1.ZodNumber]>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"hmac">;
length: z$1.ZodUnion<readonly [z$1.ZodLiteral<256>, z$1.ZodLiteral<384>, z$1.ZodLiteral<512>]>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"C20P">;
}, z$1.core.$strip>], "algorithm">;
export type KmsCreateKeyTypeOct = z$1.output<typeof zKmsCreateKeyTypeOct>;
export declare const zKmsCreateKeyTypeAsymmetric: z$1.ZodUnion<readonly [z$1.ZodObject<{
kty: z$1.ZodLiteral<"EC">;
crv: z$1.ZodEnum<{
"P-256": "P-256";
"P-384": "P-384";
"P-521": "P-521";
secp256k1: "secp256k1";
}>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"OKP">;
crv: z$1.ZodEnum<{
Ed25519: "Ed25519";
X25519: "X25519";
}>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"RSA">;
modulusLength: z$1.ZodUnion<readonly [z$1.ZodLiteral<2048>, z$1.ZodLiteral<3072>, z$1.ZodLiteral<4096>]>;
}, z$1.core.$strip>]>;
export type KmsCreateKeyTypeAsymmetric = z$1.output<typeof zKmsCreateKeyTypeAsymmetric>;
export declare const zKmsCreateKeyType: z$1.ZodUnion<readonly [z$1.ZodObject<{
kty: z$1.ZodLiteral<"EC">;
crv: z$1.ZodEnum<{
"P-256": "P-256";
"P-384": "P-384";
"P-521": "P-521";
secp256k1: "secp256k1";
}>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"OKP">;
crv: z$1.ZodEnum<{
Ed25519: "Ed25519";
X25519: "X25519";
}>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"RSA">;
modulusLength: z$1.ZodUnion<readonly [z$1.ZodLiteral<2048>, z$1.ZodLiteral<3072>, z$1.ZodLiteral<4096>]>;
}, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"aes">;
length: z$1.ZodUnion<readonly [z$1.ZodLiteral<128>, z$1.ZodLiteral<192>, z$1.ZodLiteral<256>, z$1.ZodNumber]>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"hmac">;
length: z$1.ZodUnion<readonly [z$1.ZodLiteral<256>, z$1.ZodLiteral<384>, z$1.ZodLiteral<512>]>;
}, z$1.core.$strip>, z$1.ZodObject<{
kty: z$1.ZodLiteral<"oct">;
algorithm: z$1.ZodLiteral<"C20P">;
}, z$1.core.$strip>], "algorithm">]>;
export type KmsCreateKeyType = z$1.output<typeof zKmsCreateKeyType>;
export interface KmsCreateKeyOptions<Type extends KmsCreateKeyType = KmsCreateKeyType> {
/**
* The `kid` for the key.
*/
keyId?: string;
/**
* The type of key to generate
*/
type: Type;
}
export interface KmsCreateKeyForSignatureAlgorithmOptions {
/**
* The `kid` for the key.
*/
keyId?: string;
/**
* The JWA signature algorithm to create the key for.
*/
algorithm: KnownJwaSignatureAlgorithm;
}
export interface KmsCreateKeyReturn<Type extends KmsCreateKeyType = KmsCreateKeyType> {
keyId: string;
/**
* The public JWK representation of the created key. `kid` will always
* be defined.
*
* In case of a symmetric (oct) key this won't include any key material, but
* will include additional JWK claims such as `use`, `kty`, and `kid`
*/
publicJwk: KmsJwkPublicFromCreateType<Type> & {
kid: string;
};
}
//#endregion
//# sourceMappingURL=KmsCreateKeyOptions.d.mts.map