certficate

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

This file is part of go-palletone. go-palletone is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. go-palletone is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with go-palletone. If not, see <http://www.gnu.org/licenses/>.

This file is part of go-palletone. go-palletone is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. go-palletone is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with go-palletone. If not, see <http://www.gnu.org/licenses/>.

This file is part of go-palletone. go-palletone is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. go-palletone is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with go-palletone. If not, see <http://www.gnu.org/licenses/>.

This file is part of go-palletone. go-palletone is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. go-palletone is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with go-palletone. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var DefaultCAConfig = CAConfig{}

Functions

func CertInfo2Cainfo

func CertInfo2Cainfo(certinfo CertINfo) client.CaGenInfo

func DNSNames added in v1.0.1

func DNSNames() []string

func EmailAddresses added in v1.0.1

func EmailAddresses() []string

func GenCert

func GenCert(certinfo CertINfo) ([]byte, error)

func IPAddresses added in v1.0.1

func IPAddresses() []net.IP

func RevokeCert

func RevokeCert(certinfo CertINfo, reason string) ([]byte, error)

func SaveSM2Key added in v1.0.1

func SaveSM2Key(key *sm2.PrivateKey) error

func SelfSignCertificate added in v1.0.1

func SelfSignCertificate(params *sm2.Certificate, key crypto.Signer, address string) (*sm2.Certificate, error)

func Subject added in v1.0.1

func Subject() pkix.Name

func WriteCertificate added in v1.0.1

func WriteCertificate(w io.Writer, crt *sm2.Certificate) ([]byte, error)

Types

type CAConfig

type CAConfig struct {
}

type CAGetCertChain

type CAGetCertChain struct {
	// RootCertificates is list of pem encoded certificates
	RootCertificates []*x509.Certificate
	// IntermediateCertificates is list of pem encoded intermediate certificates
	IntermediateCertificates []*pem.Block
	CAName                   string
	Version                  string
}

type CertINfo

type CertINfo struct {
	//The address as a certificate enrolleid
	Address string `json:"address"`
	//User name
	Name string `json:"name"`
	Data string `json:"data"`
	//ECert : certificate of registration
	ECert bool `json:"ecert"`

	// Type defines type of this identity (user,client, auditor etc...)
	Type string `json:"type"`
	// Affiliation associates identity with particular organization.  (gptn.mediator1...)
	Affiliation string `json:"affiliation"`

	Key interface{} `json:"key"`
}

type GmCertInfo added in v1.0.1

type GmCertInfo struct {
	Address        string
	Country        []string
	Locality       []string
	Organization   []string
	EmailAddresses namesVar
	IPAddresses    ipsVar
}

func (*GmCertInfo) GenSMCert added in v1.0.1

func (c *GmCertInfo) GenSMCert() ([]byte, error)

Jump to

Keyboard shortcuts

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