x509

package
v0.0.0-...-5f4467c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2017 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

ThreatSpec package github.com/pki-io/core/x509 as x509

ThreatSpec package github.com/pki-io/core/x509 as x509

ThreatSpec package github.com/pki-io/core/x509 as x509

ThreatSpec package github.com/pki-io/core/x509 as x509

Index

Constants

View Source
const CADefault string = `` /* 528-byte string literal not displayed */
View Source
const CASchema string = `` /* 3869-byte string literal not displayed */
View Source
const CSRDefault string = `` /* 220-byte string literal not displayed */
View Source
const CSRSchema string = `` /* 1554-byte string literal not displayed */
View Source
const CertificateDefault string = `` /* 307-byte string literal not displayed */
View Source
const CertificateSchema string = `` /* 2055-byte string literal not displayed */

Variables

This section is empty.

Functions

func NewID

func NewID() string

func NewSerial

func NewSerial() (*big.Int, error)

func PemDecodeX509CSR

func PemDecodeX509CSR(in []byte) (*x509.CertificateRequest, error)

func PemDecodeX509Certificate

func PemDecodeX509Certificate(in []byte) (*x509.Certificate, error)

func PemEncodeX509CSRDER

func PemEncodeX509CSRDER(cert []byte) []byte

func PemEncodeX509CertificateDER

func PemEncodeX509CertificateDER(cert []byte) []byte

Types

type CA

type CA struct {
	document.Document
	Data CAData
}

func NewCA

func NewCA(jsonString interface{}) (*CA, error)

func (*CA) Certificate

func (ca *CA) Certificate() (*x509.Certificate, error)

func (*CA) Dump

func (ca *CA) Dump() string

func (*CA) GenerateRoot

func (ca *CA) GenerateRoot() error

func (*CA) GenerateSub

func (ca *CA) GenerateSub(parentCA interface{}) error

ThreatSpec TMv0.1 for CA.GenerateSub Does Sub-CA certificate generation for App:X509

func (*CA) Id

func (ca *CA) Id() string

func (*CA) Load

func (ca *CA) Load(jsonString interface{}) error

func (*CA) Name

func (ca *CA) Name() string

func (*CA) PrivateKey

func (ca *CA) PrivateKey() (interface{}, error)

func (*CA) Sign

func (ca *CA) Sign(csr *CSR, useCSRSubject bool) (*Certificate, error)

ThreatSpec TMv0.1 for CA.Sign Does CSR signing by CA for App:X509

type CAData

type CAData struct {
	Scope   string `json:"scope"`
	Version int    `json:"version"`
	Type    string `json:"type"`
	Options string `json:"options"`
	Body    struct {
		Id          string `json:"id"`
		Name        string `json:"name"`
		CAExpiry    int    `json:"ca-expiry"`
		CertExpiry  int    `json:"cert-expiry"`
		Certificate string `json:"certificate"`
		PrivateKey  string `json:"private-key"`
		KeyType     string `json:"key-type"`
		DNScope     struct {
			Country            string `json:"country"`
			Organization       string `json:"organization"`
			OrganizationalUnit string `json:"organizational-unit"`
			Locality           string `json:"locality"`
			Province           string `json:"province"`
			StreetAddress      string `json:"street-address"`
			PostalCode         string `json:"postal-code"`
		} `json:"dn-scope"`
	} `json:"body"`
}

type CSR

type CSR struct {
	document.Document
	Data CSRData
}

func NewCSR

func NewCSR(jsonString interface{}) (*CSR, error)

func (*CSR) Dump

func (csr *CSR) Dump() string

func (*CSR) Generate

func (csr *CSR) Generate(subject *pkix.Name) error

func (*CSR) Id

func (csr *CSR) Id() string

func (*CSR) Load

func (csr *CSR) Load(jsonString interface{}) error

func (*CSR) Name

func (csr *CSR) Name() string

func (*CSR) Public

func (csr *CSR) Public() (*CSR, error)

func (*CSR) PublicKey

func (csr *CSR) PublicKey() (interface{}, error)

type CSRData

type CSRData struct {
	Scope   string `json:"scope"`
	Version int    `json:"version"`
	Type    string `json:"type"`
	Options string `json:"options"`
	Body    struct {
		Id         string `json:"id"`
		Name       string `json:"name"`
		CSR        string `json:"csr"`
		KeyType    string `json:"key-type"`
		PrivateKey string `json:"private-key"`
	} `json:"body"`
}

type Certificate

type Certificate struct {
	document.Document
	Data CertificateData
}

func NewCertificate

func NewCertificate(jsonString interface{}) (*Certificate, error)

func (*Certificate) Certificate

func (certificate *Certificate) Certificate() (*x509.Certificate, error)

func (*Certificate) Dump

func (certificate *Certificate) Dump() string

ThreatSpec TMv0.1 for Certificate.Dump Does certificate JSON dumping for App:X509

func (*Certificate) Generate

func (certificate *Certificate) Generate(parentCertificate interface{}, subject *pkix.Name) error

func (*Certificate) Id

func (certificate *Certificate) Id() string

func (*Certificate) Load

func (certificate *Certificate) Load(jsonString interface{}) error

func (*Certificate) Name

func (certificate *Certificate) Name() string

func (*Certificate) PrivateKey

func (certificate *Certificate) PrivateKey() (interface{}, error)

ThreatSpec TMv0.1 for Certificate.PrivateKey Returns certificate private key for App:X509

type CertificateData

type CertificateData struct {
	Scope   string `json:"scope"`
	Version int    `json:"version"`
	Type    string `json:"type"`
	Options string `json:"options"`
	Body    struct {
		Id            string   `json:"id"`
		Name          string   `json:"name"`
		Expiry        int      `json:"expiry"`
		KeyType       string   `json:"key-type"`
		Tags          []string `json:"tags"`
		Certificate   string   `json:"certificate"`
		PrivateKey    string   `json:"private-key"`
		CACertificate string   `json:"ca-certificate"`
	} `json:"body"`
}

Jump to

Keyboard shortcuts

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