/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DsaPublicKey, DsaPublicKey$inboundSchema } from "./dsapublickey.js"; import { EcdsaPublicKey, EcdsaPublicKey$inboundSchema, } from "./ecdsapublickey.js"; import { KeyAlgorithm, KeyAlgorithm$inboundSchema } from "./keyalgorithm.js"; import { RsaPublicKey, RsaPublicKey$inboundSchema } from "./rsapublickey.js"; import { UnrecognizedPublicKey, UnrecognizedPublicKey$inboundSchema, } from "./unrecognizedpublickey.js"; export type SubjectKeyInfo = { dsa?: DsaPublicKey | undefined; ecdsa?: EcdsaPublicKey | undefined; /** * The SHA-256 digest of the certificate's DER-encoded SubjectPublicKeyInfo. */ fingerprintSha256?: string | undefined; keyAlgorithm?: KeyAlgorithm | undefined; rsa?: RsaPublicKey | undefined; unrecognized?: UnrecognizedPublicKey | undefined; }; /** @internal */ export const SubjectKeyInfo$inboundSchema: z.ZodType< SubjectKeyInfo, z.ZodTypeDef, unknown > = z.object({ dsa: DsaPublicKey$inboundSchema.optional(), ecdsa: EcdsaPublicKey$inboundSchema.optional(), fingerprint_sha256: z.string().optional(), key_algorithm: KeyAlgorithm$inboundSchema.optional(), rsa: RsaPublicKey$inboundSchema.optional(), unrecognized: UnrecognizedPublicKey$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "fingerprint_sha256": "fingerprintSha256", "key_algorithm": "keyAlgorithm", }); }); export function subjectKeyInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubjectKeyInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubjectKeyInfo' from JSON`, ); }