Package-level declarations

Types

Link copied to clipboard
data class CacheEntry<T>(val value: T, val timestampMillis: Long = System.currentTimeMillis(), val ttlMillis: Long? = null)

Cached value with an optional TTL measured from timestampMillis.

Link copied to clipboard

Transcodes ECDSA signatures between ASN.1 DER (SEQUENCE { INTEGER r, INTEGER s }) and IEEE P1363 (raw fixed-width r || s) encodings, and normalizes secp256k1 signatures to low-s form.

Link copied to clipboard

Shared logging and failure conversion for KMS implementations.

Link copied to clipboard

Input validation utilities for KMS operations.

Link copied to clipboard
object KmsLogging

Logging utilities and conventions for KMS operations.

Link copied to clipboard
data class Secp256k1AuditOutcome(val id: String, val verdict: Secp256k1AuditVerdict, val detail: String? = null, val repairedSignature: ByteArray? = null)

The Secp256k1AuditVerdict for one Secp256k1AuditRecord.id. detail is populated only when Secp256k1SignatureAudit.auditBatch had to fall back to Secp256k1AuditVerdict.INVALID_OTHER because the record itself was malformed (wrong-length signature/digest, undecodable public key) rather than because a well-formed signature failed to verify.

Link copied to clipboard
data class Secp256k1AuditRecord(val id: String, val signature: ByteArray, val publicKey: ByteArray, val messageDigest: ByteArray)

One persisted signature to audit: the signature bytes, the public key that should have produced them, and the digest of the message they were computed over. id is not interpreted — it is only echoed back in Secp256k1AuditOutcome so the caller can correlate a result to the original record (a row id, a credential id, whatever the export uses).

Link copied to clipboard
data class Secp256k1AuditSummary(val total: Int, val verified: Int, val corruptedByPaddingDefect: Int, val invalidOther: Int, val outcomes: List<Secp256k1AuditOutcome>)

Aggregate result of Secp256k1SignatureAudit.auditBatch over an exported corpus of signatures. verified + corruptedByPaddingDefect + invalidOther == total.

Link copied to clipboard

Outcome of auditing one persisted secp256k1 signature. See Secp256k1SignatureAudit for what each value can and cannot conclude.

Link copied to clipboard

Minimal secp256k1 elliptic-curve arithmetic, in pure Kotlin + BigInteger, sufficient to verify an ECDSA signature and to decode a SEC 1 public key point.

Link copied to clipboard

Audits persisted secp256k1 signatures for the writeFixedWidth padding defect fixed in commit cbd1e616 (see that commit message and EcdsaSignatureCodecTest for the root cause). The defect corrupted roughly 1 in 256 signatures normalized through EcdsaSignatureCodec's pre-fix normalizeSecp256k1LowS. A library upgrade does not retroactively fix bytes already persisted before the fix — but this tool can: for the defect's specific corruption pattern, the correct signature is byte-for-byte recoverable from the corrupted one with no private key and no re-signing. classify and repair surface that repair directly (see repair and Secp256k1AuditOutcome.repairedSignature); re-signing from the underlying data remains the fallback only for records this tool cannot repair (anything classified Secp256k1AuditVerdict.INVALID_OTHER).