Documentation ¶
Index ¶
- func CreateKey(category string, bit uint) []byte
- type CertTemplate
- func (cert *CertTemplate) GetRaw() *x509.Certificate
- func (cert *CertTemplate) SetAlgorithm(category string, name string)
- func (cert *CertTemplate) SetConstraint(isCA, LimitPathLen bool, pathLen int)
- func (cert *CertTemplate) SetExpire(year, month, day int)
- func (cert *CertTemplate) SetExtUsage(usage []int)
- func (cert *CertTemplate) SetUsage(usage []int)
- type Subject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertTemplate ¶
type CertTemplate x509.Certificate
CertTemplate is a x509.Certificate wrapper for template use
func CreateTemplate ¶
func CreateTemplate(subject *pkix.Name, keyID []byte, serial int64) *CertTemplate
CreateTemplate create a most simple CertTemplate
func (*CertTemplate) GetRaw ¶
func (cert *CertTemplate) GetRaw() *x509.Certificate
GetRaw return the raw x509.Certificate
func (*CertTemplate) SetAlgorithm ¶
func (cert *CertTemplate) SetAlgorithm(category string, name string)
SetAlgorithm can simply set the algorithm that used for validate the cert itself
func (*CertTemplate) SetConstraint ¶
func (cert *CertTemplate) SetConstraint(isCA, LimitPathLen bool, pathLen int)
SetConstraint can simply set if the cert can be a CA While cert is a CA, you can limit the sub CA path length
func (*CertTemplate) SetExpire ¶
func (cert *CertTemplate) SetExpire(year, month, day int)
SetExpire can simply set the expire date (start from today 00:00)
func (*CertTemplate) SetExtUsage ¶
func (cert *CertTemplate) SetExtUsage(usage []int)
SetExtUsage can simply set the cert of the list x509.ExtKeyUsage
func (*CertTemplate) SetUsage ¶
func (cert *CertTemplate) SetUsage(usage []int)
SetUsage can simply set the cert basic usage input the index of the x509.KeyUsage (start from 1)
type Subject ¶
Subject is a pkix.Name wrapper for template use
func CreateSubject ¶
CreateSubject create a most simple Subject
func (*Subject) SetLocation ¶
SetLocation can simply set the location