pkcs7

package module
v0.0.0-...-8212a27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignDataSha1

func SignDataSha1(certFile, keyFile string, data []byte) (sd []byte, err error)

Sign the data with SHA-1 hash algorithm as defined in RFC 3174.

func SignDataSha256

func SignDataSha256(certFile, keyFile string, data []byte) (sd []byte, err error)

Sign the data with SHA256 hash algorithms as defined in FIPS 180-4.

Types

type AlgorithmIdentifier

type AlgorithmIdentifier struct {
	ID asn1.ObjectIdentifier
}

type IssuerAndSerialNumber

type IssuerAndSerialNumber struct {
	Issuer       asn1.RawValue
	SerialNumber *big.Int
}

type SignedData

type SignedData struct {
	Version          version
	DigestAlgorithms digestAlgorithmIdentifiers `asn1:"set"`
	ContentInfo      contentInfo                //data oid: 1.2.840.113549.1.7.1
	Certificate      asn1.RawValue              `asn1:"optional,explicit,tag:0"`
	SignerInfos      signerInfos                `asn1:"set"`
}

why the field Certificate is not Certificates(set) ? process Certificate in functions Ignore crls(CertificateRevocationLists), hsh 2017.11.15

type SignedDataObject

type SignedDataObject struct {
	ID         asn1.ObjectIdentifier //signedData oid: 1.2.840.113549.1.7.2
	SignedData SignedData            `asn1:"explicit,tag:0"`
}

func ParseSignedDataObjectSha1

func ParseSignedDataObjectSha1(derBytes []byte, hashed []byte) (sd SignedDataObject, err error)

func ParseSignedDataObjectSha256

func ParseSignedDataObjectSha256(derBytes []byte, hashed []byte) (sd SignedDataObject, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL