Documentation ¶
Index ¶
- Variables
- func ParseAlgorithmIdentifier(der *cryptobyte.String) (*pkix.AlgorithmIdentifier, error)
- func ParseContentInfo(der *cryptobyte.String) (oid encasn1.ObjectIdentifier, content cryptobyte.String, err error)
- func SignPKCS7(signer crypto.Signer, cert *x509.Certificate, oid encasn1.ObjectIdentifier, ...) ([]byte, error)
- type Attributes
- type PKCS7
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OIDData = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 1} OIDSignedData = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 2} OIDDigestAlgorithmSHA256 = encasn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 1} OIDEncryptionAlgorithmRSA = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} OIDAttributeContentType = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 3} OIDAttributeMessageDigest = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 4} OIDAttributeSigningTime = encasn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 5} )
OID data we need
View Source
var (
ErrNoCertificate = errors.New("no valid certificates")
)
Functions ¶
func ParseAlgorithmIdentifier ¶
func ParseAlgorithmIdentifier(der *cryptobyte.String) (*pkix.AlgorithmIdentifier, error)
Parse cryptobyte string to pkix.AlgorithmIdentifier
func ParseContentInfo ¶
func ParseContentInfo(der *cryptobyte.String) (oid encasn1.ObjectIdentifier, content cryptobyte.String, err error)
Types ¶
type Attributes ¶
type Attributes struct { ContentType encasn1.ObjectIdentifier MessageDigest []byte SigningTime time.Time Other []*unparsedAttribute }
func (*Attributes) Marshal ¶
func (a *Attributes) Marshal() []byte
type PKCS7 ¶
type PKCS7 struct { OID encasn1.ObjectIdentifier SignerInfo []*signerinfo ContentInfo []byte Certs []*x509.Certificate AlgorithmIdentifier *pkix.AlgorithmIdentifier }
func ParsePKCS7 ¶
func (*PKCS7) HasCertificate ¶
func (p *PKCS7) HasCertificate(cert *x509.Certificate) bool
Click to show internal directories.
Click to hide internal directories.