pkcs7

package
v0.0.0-...-93df0c4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MPL-2.0 Imports: 9 Imported by: 19

Documentation

Overview

Package pkcs7 provides signing based on RFC 2315.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey) ([]byte, error)

Sign data with cert & private key.

func Sign2

func Sign2(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey, intermediate *x509.Certificate) ([]byte, error)

Sign2 reader with a cert, private key, and intermediate cert.

Types

type AlgorithmIdentifier

type AlgorithmIdentifier struct {
	Algorithm  asn1.ObjectIdentifier
	Parameters asn1.RawValue
}

type Attribute

type Attribute struct {
	Type   asn1.ObjectIdentifier
	Values []interface{} `asn1:"set"`
}

func NewAttribute

func NewAttribute(typ asn1.ObjectIdentifier, val interface{}) Attribute

type Attributes

type Attributes []Attribute

type ContentInfo

type ContentInfo struct {
	ContentType asn1.ObjectIdentifier
	Content     asn1.RawValue `asn1:"optional"`
}

type IssuerAndSerialNumber

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

type SignedData

type SignedData struct {
	Version          int
	DigestAlgorithms []AlgorithmIdentifier `asn1:"set"`
	ContentInfo      ContentInfo
	Certificates     asn1.RawValue `asn1:"optional"`
	Crls             asn1.RawValue `asn1:"optional"`
	SignerInfos      []SignerInfo  `asn1:"set"`
}

type SignedDataWrapper

type SignedDataWrapper struct {
	Oid        asn1.ObjectIdentifier
	SignedData asn1.RawValue
}

type SignerInfo

type SignerInfo struct {
	Version                   int
	SignedIdentifier          IssuerAndSerialNumber
	DigestAlgorithm           AlgorithmIdentifier
	AuthenticatedAttributes   Attributes `asn1:"tag:0"`
	DigestEncryptionAlgorithm AlgorithmIdentifier
	EncryptedDigest           []byte
	UnauthenticatedAttributes int `asn1:"optional"`
}

Jump to

Keyboard shortcuts

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