Versions in this module Expand all Collapse all v0 v0.1.8 Oct 31, 2026 v0.1.7 Oct 30, 2026 v0.1.6 Oct 27, 2026 v0.1.5 Oct 21, 2026 Changes in this version + const DefaultValidity + const HeaderID + const SealVersion + func BuildSignedValue(signatureXML []byte, seal *Seal, certDER []byte, key *sm2.PrivateKey, ...) ([]byte, error) + func BuildSignedValueWithOptions(signatureXML []byte, seal *Seal, certDER []byte, key *sm2.PrivateKey, ...) ([]byte, error) + func CertificateAuthorized(typ int64, listDER, certificate []byte) error + func CertificateHash(method string, certificate []byte) ([]byte, error) + func IsIA5(s string) bool + func MarshalPrivateKeyPEM(key *sm2.PrivateKey) ([]byte, error) + func NewSelfSignedCertificate(commonName, organization string, now time.Time) (*sm2.PrivateKey, *ecdsa.PublicKey, []byte, error) + func ParseCertificateDER(data []byte) ([]byte, error) + func ParsePrivateKey(data []byte) (*sm2.PrivateKey, error) + func PictureTypeAndSize(data []byte) (string, int, int, error) + func ValidateSealForSigner(seal *Seal, signer []byte, at time.Time) error + func ValidateSigningCertificate(cert *smx509.Certificate, at time.Time) error + func ValidateSigningKey(der []byte, key *sm2.PrivateKey, at time.Time) error + type CertificateDigest struct + Type string + Value []byte + type Extension struct + Critical bool + OID asn1.ObjectIdentifier + Value []byte + type Header struct + ID string + VID string + Version int + type Picture struct + Data []byte + Height int + Type string + Width int + type Property struct + CertList asn1.RawValue + CertificateType int + CreateTime time.Time + Name string + Type int + ValidFrom time.Time + ValidTo time.Time + type Seal struct + Certificate []byte + SealInfo SealInfo + Signature asn1.BitString + SignatureAlgorithm asn1.ObjectIdentifier + func BuildSeal(params SealParams, certDER []byte, key *sm2.PrivateKey, now time.Time) (*Seal, error) + func (s *Seal) MarshalDER() ([]byte, error) + type SealInfo struct + ESID string + Extensions []Extension + Header Header + Picture Picture + Property Property + type SealParams struct + ESID string + Extensions []Extension + Height int + Name string + PictureData []byte + PictureType string + Provider string + SignerCertificates [][]byte + SignerDigests []CertificateDigest + ValidFrom time.Time + ValidTo time.Time + Width int + type SignedValue struct + Certificate []byte + Signature asn1.BitString + SignatureAlgorithm asn1.ObjectIdentifier + TBS TBSSign + TimeStamp asn1.BitString + type SigningOptions struct + Extensions []Extension + Timestamp func(signature []byte) ([]byte, error) + Validate func(seal *Seal, signerCertificate []byte, at time.Time) error + type TBSSign struct + DataHash asn1.BitString + Extensions []Extension + PropertyInfo string + Seal Seal + SignTime time.Time + Version int + type TimestampProof struct + Certificates []*smx509.Certificate + Signer *smx509.Certificate + Time time.Time + func CheckTimestamp(token, signature []byte) (*TimestampProof, error)