Documentation
¶
Index ¶
- Constants
- type CA
- type CertContainer
- func (c *CertContainer) ExportCert(passPhrase []byte) []byte
- func (c *CertContainer) ExportKey(passPhrase []byte) []byte
- func (c *CertContainer) GetX509Cert() (*x509.Certificate, error)
- func (c *CertContainer) LoadCert(pemBytes []byte, passPhrase []byte) error
- func (c *CertContainer) LoadKey(pemBytes []byte, passPhrase []byte) error
- func (c *CertContainer) PlainKey() []byte
- func (c *CertContainer) ToTls() (tls.Certificate, error)
- type CertRequest
- type PKI
- func (p *PKI) AddIntermediate(c *CertContainer) error
- func (p *PKI) AddIntermediateFromExport(export []byte, key *rsa.PrivateKey) error
- func (p *PKI) CreateCRL(ttl time.Time) (crlBytes []byte, err error)
- func (p *PKI) CreateIntermediate(EmailAddress string, Title string, ValidYears int, KeySize int) (*CertContainer, error)
- func (p *PKI) Export() ([]byte, error)
- func (p *PKI) GetCert(parent *big.Int, KeySize int, cn string, req *CertRequest) (*CertContainer, error)
- func (p *PKI) IsRevoked(cert *x509.Certificate) bool
- func (p *PKI) Revoke(cert *x509.Certificate)
- func (p *PKI) ValidateByCaRaw(derBytes []byte) (bool, error)
- func (p *PKI) Verify(cert *x509.Certificate, opts x509.VerifyOptions) error
- type PKIExport
Constants ¶
View Source
const ( DEFAULT_CERT_VALIDITY = 200 DEFAULT_ASYMKEYLEN = 6168 DEFAULT_SYMKEYLEN = 256 CERT_REVOKED = "Cert has been Revoked" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct { Organisation string DefaultCertValidYears int Id []byte Cert *export.Cert Key *export.Key IntermediatePool *x509.CertPool Revoked *pkix.CertificateList // contains filtered or unexported fields }
func LoadFromStorage ¶
func LoadFromStorage(id []byte, con *data.StorageConnection) (*CA, error)
General Methods
func (*CA) ConnectStorage ¶
func (ca *CA) ConnectStorage(con *data.StorageConnection)
type CertContainer ¶
func (*CertContainer) ExportCert ¶
func (c *CertContainer) ExportCert(passPhrase []byte) []byte
func (*CertContainer) ExportKey ¶
func (c *CertContainer) ExportKey(passPhrase []byte) []byte
func (*CertContainer) GetX509Cert ¶
func (c *CertContainer) GetX509Cert() (*x509.Certificate, error)
func (*CertContainer) LoadCert ¶
func (c *CertContainer) LoadCert(pemBytes []byte, passPhrase []byte) error
func (*CertContainer) LoadKey ¶
func (c *CertContainer) LoadKey(pemBytes []byte, passPhrase []byte) error
func (*CertContainer) PlainKey ¶
func (c *CertContainer) PlainKey() []byte
func (*CertContainer) ToTls ¶
func (c *CertContainer) ToTls() (tls.Certificate, error)
type CertRequest ¶
type PKI ¶
type PKI struct { Serial *big.Int Organisation string DefaultCertValidYears int Intermediate map[string]*CertContainer IntermediatePool *x509.CertPool Revoked []pkix.RevokedCertificate Crl []byte CrlTTL time.Time // contains filtered or unexported fields }
func LoadPkiFromPEMBlock ¶
func (*PKI) AddIntermediate ¶
func (p *PKI) AddIntermediate(c *CertContainer) error
func (*PKI) AddIntermediateFromExport ¶
func (p *PKI) AddIntermediateFromExport(export []byte, key *rsa.PrivateKey) error
func (*PKI) CreateIntermediate ¶
func (*PKI) GetCert ¶
func (p *PKI) GetCert(parent *big.Int, KeySize int, cn string, req *CertRequest) (*CertContainer, error)
func (*PKI) Revoke ¶
func (p *PKI) Revoke(cert *x509.Certificate)
func (*PKI) Verify ¶
func (p *PKI) Verify(cert *x509.Certificate, opts x509.VerifyOptions) error
Click to show internal directories.
Click to hide internal directories.