Documentation ¶
Index ¶
Constants ¶
const GOSTR3410_2012_256 = GOSTR3410_2001
Variables ¶
Functions ¶
Types ¶
type Attribute ¶
type Attribute struct { Type asn1.ObjectIdentifier Value interface{} }
asn.1 CMS::SignerInfo RFC5652
type CMS ¶
type CMS struct { Content []byte Certificates []*Certificate CRLs []pkix.CertificateList Signers []signerInfo // contains filtered or unexported fields }
CMS represent Cryptographic Message Syntax (CMS) with Signed-data Content Type RFC5652
func (*CMS) CertificateSerial ¶
CertificateSerial returns Signer first Certificate serial number.
func (*CMS) Verify ¶
Verify CMS validity. check equality CMS content and provided value @content check signing time in the range between notBefore-notAfter check content digest check content signature over provided signer certificates
func (*CMS) VerifyCertificates ¶
func (cms *CMS) VerifyCertificates(ca []*Certificate) error
VerifyCertificates validate CMS signer certificates over proived Certificate Authority
type Certificate ¶
type Certificate struct { Raw asn1.RawContent TBSCertificate tbsCertificate SignatureAlgorithm pkix.AlgorithmIdentifier SignatureValue asn1.BitString }
func ParseCertificate ¶
func ParseCertificate(asn1Data []byte) (*Certificate, error)
ParseCertificate parses a single certificate from the given ASN.1 DER data.
func (*Certificate) CheckSignature ¶
func (c *Certificate) CheckSignature(algo *SignatureAlgorithm, signed, signature []byte) error
Verifies signature over certificate public key
func (*Certificate) CheckSignatureFrom ¶
func (c *Certificate) CheckSignatureFrom(parent *Certificate) error
CheckSignatureFrom verifies that the signature on c is a valid signature from parent.
type GOSTCryptoProParameters ¶
type GOSTCryptoProParameters struct {
ParamSet []asn1.ObjectIdentifier
}
type HashFunction ¶
type HashFunction int
const ( UnknownHashFunction HashFunction = iota SHA1 SHA256 SHA384 SHA512 GOSTR3411_94 GOSTR3411_2012_256 //Stribog GOST R 34.11-2012 256-bit GOSTR3411_2012_512 //Stribog GOST R 34.11-2012 512-bit )
func GetHashForOid ¶
func GetHashForOid(oid asn1.ObjectIdentifier) HashFunction
func (HashFunction) Actual ¶
func (h HashFunction) Actual() bool
func (HashFunction) CryptoHash ¶
func (h HashFunction) CryptoHash() crypto.Hash
func (HashFunction) New ¶
func (h HashFunction) New() hash.Hash
type PublicKeyAlgorithm ¶
type PublicKeyAlgorithm int
const ( UnknownAlgorithm PublicKeyAlgorithm = iota RSA DSA RSAPSS ECDSA GOSTR3410_2001 GOSTR3410_2012_512 )
func (PublicKeyAlgorithm) Actual ¶
func (h PublicKeyAlgorithm) Actual() bool
type SignatureAlgorithm ¶
type SignatureAlgorithm struct {
// contains filtered or unexported fields
}
func GetSignatureAlgorithmForOid ¶
func GetSignatureAlgorithmForOid(oid asn1.ObjectIdentifier) *SignatureAlgorithm
func (*SignatureAlgorithm) Family ¶
func (algo *SignatureAlgorithm) Family() CryptoFamily