Documentation
¶
Index ¶
- Variables
- 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 ¶
var ErrDecodeCACert = errors.New("Can't decode CA cert file")
Functions ¶
func CRLInfo ¶
func CRLInfo(rl *x509.RevocationList) string
func CertInfo ¶
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 ¶
type CertRevocationList struct {
Byte []byte
}
CertRevocationList hold certificate revocation list
func CreateCRL ¶
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 ¶
func RevokeCertificate(crl []byte, cert *x509.Certificate, caCert *x509.Certificate, pkey *ecdsa.PrivateKey, nextUpdate time.Time) (*CertRevocationList, *big.Int, error)
func (*CertRevocationList) String ¶
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