pkcs10

package module
v0.0.0-...-7c668d9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: BSD-2-Clause Imports: 11 Imported by: 0

README

No longer maintained

This project is no longer being maintained. Go 1.3 added support for PKCS#10 certificate signing requests to the crypto/x509 package.

pkcs10

Package pkcs10 parses and creates PKCS#10 certificate signing requests, as specified in RFC 2986.

Build Status

Documentation

http://godoc.org/github.com/jstemmer/pkcs10

License

See LICENSE.

Some unexported functions and variables in the official crypto/x509 package from the Go source have been used, all contained in the x509.go file, under the license in LICENSE-GO.

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"`
}

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
}

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.

Jump to

Keyboard shortcuts

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