Files
suaveplan/packages/security-stack/security/tpm-struct/src/index.ts
2026-05-27 23:47:53 +01:00

120 lines
3.0 KiB
TypeScript

// Public surface — explicit named re-exports per openspec/AGENTS.md §6a.
// Algorithm registries
export {
algIdToName,
eccCurveToName,
nameToAlgId,
nameToEccCurve,
TPM_ALG,
TPM_ECC_CURVE,
type TpmAlgId,
type TpmEccCurve,
} from "./alg/alg.js";
// Attest area
export { parseTpmsAttest } from "./attest/attest.js";
export {
type ClockInfo,
TPM_GENERATED_VALUE,
TPM_ST_ATTEST,
type TpmsAttest,
type TpmsAttestCertify,
type TpmsAttestCommandAudit,
type TpmsAttestCreation,
type TpmsAttestNv,
type TpmsAttestNvDigest,
type TpmsAttestQuote,
type TpmsAttestSessionAudit,
type TpmsAttestTime,
type TpmsCertifyInfo,
type TpmsCommandAuditInfo,
type TpmsCreationInfo,
type TpmsNvCertifyInfo,
type TpmsNvDigestCertifyInfo,
type TpmsPcrSelection,
type TpmsQuoteInfo,
type TpmsSessionAuditInfo,
type TpmsTimeAttestInfo,
type TpmsTimeInfo,
} from "./attest/attest.types.js";
export { serializeTpmsAttest } from "./attest/serialize.js";
// Buffer primitives
export { TpmBufferReader, TpmBufferWriter } from "./buffer/buffer.js";
export type {
Tpm2bReadResult,
TpmReaderOptions,
TpmWriterOptions,
} from "./buffer/buffer.types.js";
// Diagnostic
export { toDiagnostic } from "./diagnostic/diagnostic.js";
// Errors
export {
TPM_STRUCT_CODES,
TpmStructError,
type TpmStructErrorCode,
tpmStructError,
} from "./errors/error-codes.js";
// Extra-data
export { extraDataMatches } from "./extra-data/extra-data.js";
export type { ConstantTimeEqual } from "./extra-data/extra-data.types.js";
// Name digest
export { computeTpmtPublicName } from "./name/name.js";
export type { HashLike } from "./name/name.types.js";
// Observability
export {
type ParseKind,
type ParseOutcome,
type PublicBranch,
recordAlgObserved,
recordAttestDuration,
recordNameDuration,
recordParseDuration,
recordParseError,
recordParseTotal,
recordPublicDuration,
resetTpmStructMetricsForTesting,
} from "./observability/metrics.js";
// Public area
export {
decodeObjectAttributes,
encodeObjectAttributes,
} from "./public/object-attributes.js";
export { parseTpmtPublic } from "./public/public.js";
export type {
ObjectAttributes,
ObjectAttributesFlags,
TpmRsaUnique,
TpmsEccParms,
TpmsEccPoint,
TpmsKeyedHashParms,
TpmsRsaParms,
TpmsSymCipherParms,
TpmtEccScheme,
TpmtKdfScheme,
TpmtPublic,
TpmtPublicEcc,
TpmtPublicKeyedHash,
TpmtPublicRsa,
TpmtPublicSymCipher,
TpmtRsaScheme,
TpmtSymDefObject,
} from "./public/public.types.js";
export { serializeTpmtPublic } from "./public/serialize.js";
// Boundary schemas
export {
ClockInfoSchema,
ObjectAttributesSchema,
Tpm2bSchema,
TpmAlgIdSchema,
TpmEccCurveSchema,
TpmsAttestSchema,
TpmsCertifyInfoSchema,
TpmsEccParmsSchema,
TpmsKeyedHashParmsSchema,
TpmsRsaParmsSchema,
TpmsSymCipherParmsSchema,
TpmtPublicSchema,
validateTpmsAttest,
validateTpmtPublic,
} from "./schemas/schemas.js";