cca

package
v0.0.2-0...-0d7cfed Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurveP256 = 0
	CurveP384 = 1
	CurveP521 = 2
)

Variables

View Source
var CAServerMap map[string]*CAServer
View Source
var CurveP256OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
View Source
var CurveP384OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
View Source
var CurveP521OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
View Source
var RoleLabel string = "roleName"
View Source
var RoleName asn1.ObjectIdentifier = asn1.ObjectIdentifier{2, 5, 29, 9}

Functions

func Base64Decode

func Base64Decode(in string) ([]byte, error)

func Base64Encode

func Base64Encode(in []byte) string

func GenerateECCSR

func GenerateECCSR(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint) ([]byte, error)

func GenerateECKey

func GenerateECKey(curve uint8) (*ecdsa.PrivateKey, error)

func GenerateSelfSignedCert

func GenerateSelfSignedCert(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint, validity uint64, serial int64) ([]byte, error)

func GenerateSignedCert

func GenerateSignedCert(csr *x509.CertificateRequest, cakey *ecdsa.PrivateKey, cacert *x509.Certificate, sigalgo uint, validity uint64, serial int64) ([]byte, error)

func GetCertFingerprint

func GetCertFingerprint(certder []byte) ([]byte, x509.SignatureAlgorithm)

func GetCertObject

func GetCertObject(certder []byte) (*x509.Certificate, error)

func GetCertPem

func GetCertPem(cerder []byte) string

func GetECKeyDer

func GetECKeyDer(key *ecdsa.PrivateKey) ([]byte, error)

func GetECKeyPem

func GetECKeyPem(pk *ecdsa.PrivateKey) string

func GetECKeyPemWithAttr

func GetECKeyPemWithAttr(pk *ecdsa.PrivateKey, curve uint8) string

func GetECPubKeyDer

func GetECPubKeyDer(key *ecdsa.PrivateKey) ([]byte, error)

func GetMaxValidity

func GetMaxValidity(startval, maxcaval time.Time, validity uint64) time.Duration

func GetSHA1Hash

func GetSHA1Hash(in []byte) []byte

func GetSubKeyID

func GetSubKeyID(key *ecdsa.PrivateKey) ([]byte, error)

func GetSubKeyIDFromPInterface

func GetSubKeyIDFromPInterface(pubkey interface{}) ([]byte, error)

func HandleGetCACert

func HandleGetCACert(id string) ([]byte, error)

func HandleSimpleEnrollRequest

func HandleSimpleEnrollRequest(id, csr string) ([]byte, error)

func ParseCSR

func ParseCSR(csr []byte) (*x509.CertificateRequest, error)

func PemDecode

func PemDecode(in []byte) (*pem.Block, error)

func PemEncode

func PemEncode(in []byte, ptype string) []byte

func UpdateCSRRole

func UpdateCSRRole(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable)

func UpdateCSRSubName

func UpdateCSRSubName(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable, profItem *config.CAProfile)

func ValidateCSR

func ValidateCSR(csr *x509.CertificateRequest) bool

Types

type CAServer

type CAServer struct {
	Name        string
	CAConfig    *config.CA
	EnrollCount uint64
	Cert        []byte
	Key         []byte
	LastSerial  []byte
}

type DN

type DN struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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