| 1 | import type * as paymentcryptography from "@distilled.cloud/aws/payment-cryptography"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Key } from "./Key.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `payment-cryptography:GetPublicKeyCertificate` — |
| 8 | * exports the public-key certificate (and its root certificate chain) of an |
| 9 | * asymmetric key pair {@link Key}, e.g. to share the public verification key |
| 10 | * with a partner. The private key never leaves the service. Provide |
| 11 | * `GetPublicKeyCertificateHttp` on the Function to satisfy this service. |
| 12 | * ### Public Key Certificates |
| 13 | * **Example:** Export the public key certificate of a signing key |
| 14 | * ```typescript |
| 15 | * // init |
| 16 | * const getPublicKeyCertificate = |
| 17 | * yield* PaymentCryptography.GetPublicKeyCertificate(signKey); |
| 18 | * |
| 19 | * // runtime — both fields are base64-encoded certificates |
| 20 | * const { KeyCertificate, KeyCertificateChain } = |
| 21 | * yield* getPublicKeyCertificate(); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface GetPublicKeyCertificate extends Binding.Service< |
| 27 | GetPublicKeyCertificate, |
| 28 | "AWS.PaymentCryptography.GetPublicKeyCertificate", |
| 29 | <K extends Key>( |
| 30 | key: K, |
| 31 | ) => Effect.Effect< |
| 32 | () => Effect.Effect< |
| 33 | paymentcryptography.GetPublicKeyCertificateOutput, |
| 34 | paymentcryptography.GetPublicKeyCertificateError |
| 35 | > |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const GetPublicKeyCertificate = Binding.Service<GetPublicKeyCertificate>( |
| 40 | "AWS.PaymentCryptography.GetPublicKeyCertificate", |
| 41 | ); |