Versions in this module Expand all Collapse all v1 v1.2.0 May 11, 2023 Changes in this version + var RandReader = rand.Reader + var SM2UID = []byte + var StrictOrderCheck = true + type Algorithm uint16 + const AlgNull + const AlgRSA + const AlgRSASSA + const AlgSHA1 + const AlgSHA256 + const AlgUnknown + func GetAlgFromString(name string) (Algorithm, error) + func (a Algorithm) Hash() (hash.Hash, error) + func (a Algorithm) IsNull() bool + func (a Algorithm) String() string + func (v Algorithm) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (v Algorithm) ReadFrom(r io.Reader) (int64, error) + func (v Algorithm) TotalSize() uint64 + func (v Algorithm) WriteTo(w io.Writer) (int64, error) + type BitSize uint16 + func (ks *BitSize) SetInBits(amountOfBits uint16) + func (ks *BitSize) SetInBytes(amountOfBytes uint16) + func (ks BitSize) InBits() uint16 + func (ks BitSize) InBytes() uint16 + func (v BitSize) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (v BitSize) ReadFrom(r io.Reader) (int64, error) + func (v BitSize) TotalSize() uint64 + func (v BitSize) WriteTo(w io.Writer) (int64, error) + type Element interface + GetStructInfo func() StructInfo + ReadDataFrom func(r io.Reader) (int64, error) + SetStructInfo func(StructInfo) + type ElementsContainer interface + GetFieldByStructID func(structID string) interface{} + type HashStructure struct + HashAlg Algorithm + HashBuffer []byte + func NewHashStructure() *HashStructure + func (s *HashStructure) HashAlgOffset() uint64 + func (s *HashStructure) HashAlgTotalSize() uint64 + func (s *HashStructure) HashBufferOffset() uint64 + func (s *HashStructure) HashBufferTotalSize() uint64 + func (s *HashStructure) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *HashStructure) ReadFrom(r io.Reader) (int64, error) + func (s *HashStructure) Rehash() + func (s *HashStructure) RehashRecursive() + func (s *HashStructure) TotalSize() uint64 + func (s *HashStructure) Validate() error + func (s *HashStructure) WriteTo(w io.Writer) (int64, error) + type HashStructureFill struct + HashAlg Algorithm + HashBuffer []byte + func NewHashStructureFill() *HashStructureFill + func (s *HashStructureFill) HashAlgOffset() uint64 + func (s *HashStructureFill) HashAlgTotalSize() uint64 + func (s *HashStructureFill) HashBufferOffset() uint64 + func (s *HashStructureFill) HashBufferTotalSize() uint64 + func (s *HashStructureFill) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *HashStructureFill) ReadFrom(r io.Reader) (int64, error) + func (s *HashStructureFill) Rehash() + func (s *HashStructureFill) RehashRecursive() + func (s *HashStructureFill) TotalSize() uint64 + func (s *HashStructureFill) Validate() error + func (s *HashStructureFill) WriteTo(w io.Writer) (int64, error) + type Key struct + Data []byte + KeyAlg Algorithm + KeySize BitSize + Version uint8 + func NewKey() *Key + func (k *Key) PrintBPMPubKey(bpmAlg Algorithm) error + func (k *Key) PrintKMPubKey(kmAlg Algorithm) error + func (k *Key) SetPubKey(key crypto.PublicKey) error + func (k Key) PubKey() (crypto.PublicKey, error) + func (s *Key) DataOffset() uint64 + func (s *Key) DataTotalSize() uint64 + func (s *Key) KeyAlgOffset() uint64 + func (s *Key) KeyAlgTotalSize() uint64 + func (s *Key) KeySizeOffset() uint64 + func (s *Key) KeySizeTotalSize() uint64 + func (s *Key) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *Key) ReadFrom(r io.Reader) (int64, error) + func (s *Key) Rehash() + func (s *Key) RehashRecursive() + func (s *Key) TotalSize() uint64 + func (s *Key) Validate() error + func (s *Key) VersionOffset() uint64 + func (s *Key) VersionTotalSize() uint64 + func (s *Key) WriteTo(w io.Writer) (int64, error) + type KeySignature struct + Key Key + Signature Signature + Version uint8 + func NewKeySignature() *KeySignature + func (ks *KeySignature) FillSignature(signAlgo Algorithm, pubKey crypto.PublicKey, signedData []byte, ...) error + func (ks *KeySignature) SetSignature(signAlgo Algorithm, privKey crypto.Signer, signedData []byte) error + func (ks *KeySignature) SetSignatureAuto(privKey crypto.Signer, signedData []byte) error + func (m *KeySignature) Verify(signedData []byte) error + func (s *KeySignature) KeyOffset() uint64 + func (s *KeySignature) KeyTotalSize() uint64 + func (s *KeySignature) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *KeySignature) ReadFrom(r io.Reader) (int64, error) + func (s *KeySignature) Rehash() + func (s *KeySignature) RehashRecursive() + func (s *KeySignature) SignatureOffset() uint64 + func (s *KeySignature) SignatureTotalSize() uint64 + func (s *KeySignature) TotalSize() uint64 + func (s *KeySignature) Validate() error + func (s *KeySignature) VersionOffset() uint64 + func (s *KeySignature) VersionTotalSize() uint64 + func (s *KeySignature) WriteTo(w io.Writer) (int64, error) + type Manifest interface + type SVN uint8 + func (svn SVN) SVN() uint8 + func (v SVN) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (v SVN) ReadFrom(r io.Reader) (int64, error) + func (v SVN) TotalSize() uint64 + func (v SVN) WriteTo(w io.Writer) (int64, error) + type Signature struct + Data []byte + HashAlg Algorithm + KeySize BitSize + SigScheme Algorithm + Version uint8 + func NewSignature() *Signature + func (m *Signature) FillSignature(signAlgo Algorithm, pubKey crypto.PublicKey, signedData []byte, ...) error + func (m *Signature) SetSignature(signAlgo Algorithm, privKey crypto.Signer, signedData []byte) error + func (m *Signature) SetSignatureByData(sig SignatureDataInterface, hashAlgo Algorithm) error + func (m *Signature) SetSignatureData(sig SignatureDataInterface) error + func (m Signature) SignatureData() (SignatureDataInterface, error) + func (s *Signature) DataOffset() uint64 + func (s *Signature) DataTotalSize() uint64 + func (s *Signature) HashAlgOffset() uint64 + func (s *Signature) HashAlgTotalSize() uint64 + func (s *Signature) KeySizeOffset() uint64 + func (s *Signature) KeySizeTotalSize() uint64 + func (s *Signature) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *Signature) ReadFrom(r io.Reader) (int64, error) + func (s *Signature) Rehash() + func (s *Signature) RehashRecursive() + func (s *Signature) SigSchemeOffset() uint64 + func (s *Signature) SigSchemeTotalSize() uint64 + func (s *Signature) TotalSize() uint64 + func (s *Signature) Validate() error + func (s *Signature) VersionOffset() uint64 + func (s *Signature) VersionTotalSize() uint64 + func (s *Signature) WriteTo(w io.Writer) (int64, error) + type SignatureDataInterface interface + Verify func(pk crypto.PublicKey, signedData []byte) error + func NewSignatureByData(signAlgo Algorithm, pubKey crypto.PublicKey, signedData []byte) (SignatureDataInterface, error) + func NewSignatureData(signAlgo Algorithm, privKey crypto.Signer, signedData []byte) (SignatureDataInterface, error) + type SignatureRSAASA []byte + func (s SignatureRSAASA) String() string + func (s SignatureRSAASA) Verify(pkIface crypto.PublicKey, signedData []byte) error + type StructInfo struct + ID StructureID + Version uint8 + func NewStructInfo() *StructInfo + func (s *StructInfo) IDOffset() uint64 + func (s *StructInfo) IDTotalSize() uint64 + func (s *StructInfo) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string + func (s *StructInfo) ReadFrom(r io.Reader) (int64, error) + func (s *StructInfo) Rehash() + func (s *StructInfo) RehashRecursive() + func (s *StructInfo) TotalSize() uint64 + func (s *StructInfo) Validate() error + func (s *StructInfo) VersionOffset() uint64 + func (s *StructInfo) VersionTotalSize() uint64 + func (s *StructInfo) WriteTo(w io.Writer) (int64, error) + func (s StructInfo) StructInfo() StructInfo + type Structure interface + PrettyString func(depth uint, withHeader bool, opts ...pretty.Option) string + TotalSize func() uint64 + type StructureID [8]byte + func (s StructureID) String() string