Documentation ¶
Overview ¶
Package pkcs10 parses and creates PKCS#10 certificate signing requests, as specified in RFC 2986.
All contents of the x509.go file are taken from the official Go crypto/x509 package.
Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE-GO file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertificateSigningRequest ¶
func CreateCertificateSigningRequest(rand io.Reader, template *CertificateSigningRequest, priv interface{}) (csr []byte, err error)
CreateCertificateSigningRequest creates a new certificate signing request based on a template. The following members of template are used: Subject.
The certificate signing request is signed with the parameter priv which is the private key of the requester. The public part of the priv key is included in the certification request information
The returned slice is the certificate signing request in DER encoding.
The only supported key type are RSA and ECDSA (*rsa.PrivateKey or *ecdsa.PrivateKey for priv)
Types ¶
type Attribute ¶
type Attribute struct { Type asn1.ObjectIdentifier Values asn1.RawValue `asn1:"set"` }
Attribute specifies a generic CSR key pair
type CertificateSigningRequest ¶
type CertificateSigningRequest struct { Raw []byte RawCertificationRequestInfo []byte RawSubject []byte RawSubjectPublicKeyInfo []byte Signature []byte SignatureAlgorithm x509.SignatureAlgorithm PublicKeyAlgorithm x509.PublicKeyAlgorithm PublicKey interface{} Version int Subject pkix.Name Attributes []Attribute }
CertificateSigningRequest represents a PKCS#10 CSR.
func ParseCertificateSigningRequest ¶
func ParseCertificateSigningRequest(asn1Data []byte) (*CertificateSigningRequest, error)
ParseCertificateSigningRequest parses a certificate signing request from the given ASN.1 DER data.
func (*CertificateSigningRequest) CheckSignature ¶
func (c *CertificateSigningRequest) CheckSignature() (err error)
CheckSignature verifies that the signature on c is a valid signature using the public key in c.