Documentation
¶
Index ¶
- func CRLInfo(rl *x509.RevocationList) string
- func CertInfo(cert *x509.Certificate) string
- func GetPublicKey(pub interface{}) (string, error)
- func GetSerial() (*big.Int, error)
- func ParseCRL(crl []byte) (*x509.RevocationList, error)
- func ParseCertificate(cert []byte) (*x509.Certificate, error)
- func ParsePrivateKey(pkey []byte) (*ecdsa.PrivateKey, error)
- type CertRevocationList
- type Certificate
- type PrivateKey
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRLInfo ¶ added in v1.8.0
func CRLInfo(rl *x509.RevocationList) string
func CertInfo ¶ added in v1.2.0
func CertInfo(cert *x509.Certificate) string
CertInfo returns certificate information
func GetPublicKey ¶
GetPublicKey returns string of pem encoded structure from given public key
func ParseCertificate ¶
func ParseCertificate(cert []byte) (*x509.Certificate, error)
ParseCertificate returns parsed certificate and error
func ParsePrivateKey ¶
func ParsePrivateKey(pkey []byte) (*ecdsa.PrivateKey, error)
ParsePrivatekey parse given []byte private key to struct *ecdsa.PrivateKey
Types ¶
type CertRevocationList ¶ added in v1.8.0
type CertRevocationList struct {
Byte []byte
}
CertRevocationList hold certificate revocation list
func CreateCRL ¶ added in v1.8.0
func CreateCRL(pkey *ecdsa.PrivateKey, caCert *x509.Certificate, crl *x509.RevocationList, nextUpdate time.Time) (*CertRevocationList, *big.Int, error)
CreateCRL Create certificate revocation list
func RevokeCertificate ¶ added in v1.8.0
func RevokeCertificate(crl []byte, cert *x509.Certificate, caCert *x509.Certificate, pkey *ecdsa.PrivateKey, nextUpdate time.Time) (*CertRevocationList, *big.Int, error)
func (*CertRevocationList) String ¶ added in v1.8.0
func (c *CertRevocationList) String() string
String return string of certificate revocation list in pem encoded format
type Certificate ¶
type Certificate struct {
SerialNumber *big.Int
Subject pkix.Name
NotBefore time.Time
NotAfter time.Time
IPAddress []net.IP
DNSNames []string
IsCA bool
Parent *x509.Certificate
ParentPrivateKey interface{}
KeyUsage x509.KeyUsage
ExtentedKeyUsage []x509.ExtKeyUsage
SubjectKeyId []byte
AuthorityKeyId []byte
}
Certificate hold certificate information
func (*Certificate) GetCertificate ¶
func (c *Certificate) GetCertificate(pkey *ecdsa.PrivateKey) (*Result, error)
GetCertificate generate certificate and returns it in Result struct
func (*Certificate) SetTemplate ¶
func (c *Certificate) SetTemplate() x509.Certificate
SetTemplate set template for x509.Certificate from given Certificate struct
type PrivateKey ¶
type PrivateKey struct {
*ecdsa.PrivateKey
}
PrivateKey hold private key
func GetPrivateKey ¶
func GetPrivateKey() (*PrivateKey, error)
GetPrivateKey returns struct PrivateKey containing the private key
func (*PrivateKey) String ¶
func (p *PrivateKey) String() string
String returns string of private key in pem encoded format