Documentation ¶
Index ¶
- func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
- func ParseCertificateFromPem(privPEM []byte) (*x509.Certificate, error)
- func ParseRsaPrivateKeyFromPem(privPEM []byte) (*rsa.PrivateKey, error)
- func RsaPrivateKeyToPem(priv *rsa.PrivateKey) []byte
- func RsaPublicKeyToPem(pub *rsa.PublicKey) []byte
- func Setup()
- type CA
- type CAImpl
- type Identity
- type IdentityImpl
- func (id *IdentityImpl) CreateKeyPair()
- func (id *IdentityImpl) Label() string
- func (id *IdentityImpl) Load(filename string) error
- func (id *IdentityImpl) PrivateKey() *rsa.PrivateKey
- func (id *IdentityImpl) PublicKey() *rsa.PublicKey
- func (id *IdentityImpl) Save(filename string) error
- func (id *IdentityImpl) X509Cert() *x509.Certificate
- type PKIDir
- type PkiGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRsaKeyPair ¶
func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
func ParseCertificateFromPem ¶
func ParseCertificateFromPem(privPEM []byte) (*x509.Certificate, error)
func ParseRsaPrivateKeyFromPem ¶
func ParseRsaPrivateKeyFromPem(privPEM []byte) (*rsa.PrivateKey, error)
func RsaPrivateKeyToPem ¶
func RsaPrivateKeyToPem(priv *rsa.PrivateKey) []byte
func RsaPublicKeyToPem ¶
Types ¶
type CA ¶
type CA interface { Identity IssueCertificate(pub interface{}, template *x509.Certificate) (*x509.Certificate, error) }
type CAImpl ¶
type CAImpl struct {
IdentityImpl
}
func (*CAImpl) IssueCertificate ¶
func (ca *CAImpl) IssueCertificate(pub interface{}, template *x509.Certificate) (*x509.Certificate, error)
type Identity ¶
type Identity interface { Label() string X509Cert() *x509.Certificate PublicKey() *rsa.PublicKey PrivateKey() *rsa.PrivateKey Save(filename string) error }
CA can be used to issue other certs
func CreateIdentity ¶
func LoadIdentity ¶
type IdentityImpl ¶
type IdentityImpl struct {
// contains filtered or unexported fields
}
func (*IdentityImpl) CreateKeyPair ¶
func (id *IdentityImpl) CreateKeyPair()
func (*IdentityImpl) Label ¶
func (id *IdentityImpl) Label() string
func (*IdentityImpl) Load ¶
func (id *IdentityImpl) Load(filename string) error
func (*IdentityImpl) PrivateKey ¶
func (id *IdentityImpl) PrivateKey() *rsa.PrivateKey
func (*IdentityImpl) PublicKey ¶
func (id *IdentityImpl) PublicKey() *rsa.PublicKey
func (*IdentityImpl) Save ¶
func (id *IdentityImpl) Save(filename string) error
func (*IdentityImpl) X509Cert ¶
func (id *IdentityImpl) X509Cert() *x509.Certificate
type PKIDir ¶
type PKIDir interface { GetGenerator() *PkiGenerator GetIdentities() (identities []Identity, err error) }
PKIDir provides access to certificate/private_keys stored in a directory
type PkiGenerator ¶
func (*PkiGenerator) GenerateRoot ¶
func (p *PkiGenerator) GenerateRoot() (err error)
func (*PkiGenerator) GenerateServerCert ¶
func (p *PkiGenerator) GenerateServerCert(name string, dns ...string) (err error)
Click to show internal directories.
Click to hide internal directories.