Documentation
¶
Overview ¶
Package internal provides shared internal utilities for the CMS package.
Package internal provides shared internal utilities for the CMS package.
Index ¶
Constants ¶
const ( SigTypeCMS = "cms" OpSign = "sign" OpVerify = "verify" KeyTypePublic = "public" KeyTypePrivate = "private" )
Signature and operation type constants
const ( // MaxSignatureSize is the maximum allowed CMS signature size (1MB) // This prevents memory exhaustion attacks from malformed signatures MaxSignatureSize = 1024 * 1024 // MaxCertSize is the maximum allowed certificate size (64KB) // Standard X.509 certificates are typically 1-4KB MaxCertSize = 64 * 1024 )
Size limits for CMS structures
Variables ¶
This section is empty.
Functions ¶
func MarshalImplicitHeader ¶
MarshalImplicitHeader creates an IMPLICIT [0] tag header with the given length. Returns the DER-encoded tag and length bytes for IMPLICIT [0] (tag 0xA0).
func MarshalSafe ¶
MarshalSafe wraps asn1.Marshal with explicit error checking. This helper is used throughout the CMS package to ensure all ASN.1 encoding operations properly handle errors.
func MarshalSequenceHeader ¶
MarshalSequenceHeader creates a SEQUENCE header with the given length. Returns the DER-encoded tag and length bytes for a SEQUENCE.
func MarshalSetHeader ¶
MarshalSetHeader creates a SET header with the given length. Returns the DER-encoded tag and length bytes for a SET.
Types ¶
This section is empty.