mypkcs7

package module
v0.0.0-...-639a5d7 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

README

pkcs7

PKCS7 signedData parser for authenticode.

Warning

Currently, only extracing information is supported. Other features such as verification will be supported soon.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//OIDSignedData is signedData OIDs
	OIDSignedData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 2}
	//OIDContentType is one of Attributes
	OIDContentType = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 3}
	//OIDSigningTime is one of Attributes
	OIDSigningTime = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 5}
	//OIDMessageDigest is one of Attributes
	OIDMessageDigest = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 4}
	//OIDPKCS7 is PKCS#7
	OIDPKCS7 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 1}

	//OIDSpcStatementTypeObjID 1.3.6.1.4.1.311.2.1.11
	OIDSpcStatementTypeObjID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 2, 1, 11}
	//OIDSpcSPOpusInfoObjID 1.3.6.1.4.1.311.2.1.12
	OIDSpcSPOpusInfoObjID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 2, 1, 12}
)

Functions

This section is empty.

Types

type PKCS7

type PKCS7 struct {
	Raw                        interface{}
	ContentType                asn1.ObjectIdentifier      // should be signedData
	Version                    int                        // signedData version
	DigestAlgorithmIdentifiers []pkix.AlgorithmIdentifier // used to sign the contents of the ContentInfo type
	Certificates               []*x509.Certificate        // list of x509 certs
	CRLs                       []pkix.CertificateList     // CRLs
	SignerInfos                []signerInfo               // list of signature information
}

PKCS7 has SignData and signature information (signerInfo) Because Authenticode signatures support only one signer, digestAlgorithms must contain only one digestAlgorithmIdentifier structure and the structure must match the value set in the SignerInfo structure's digestAlgorithm field. If not, the signature has been tampered with.

func ParsePKCS7

func ParsePKCS7(asn1Data []byte) (*PKCS7, error)

ParsePKCS7 decodes a DER encoded PKCS7 package It returns a PKCS#7

Jump to

Keyboard shortcuts

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