Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Certificate ¶
type Certificate struct { Subject pkix.Name NotBefore time.Time NotAfter time.Time IPAddress []net.IP DNSNames []string IsCA bool Parent *x509.Certificate ParentPrivateKey interface{} ExtentedKeyUsage []x509.ExtKeyUsage }
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(serial *big.Int) 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
Click to show internal directories.
Click to hide internal directories.