Documentation ¶
Index ¶
- Constants
- func NewCName(commonName string) pkix.Name
- func NewCSR(key ed25519.PrivateKey, name pkix.Name) (*x509.CertificateRequest, error)
- func NewEndEntityCert(key ed25519.PrivateKey, req *x509.CertificateRequest, parent *x509.Certificate, ...) (*x509.Certificate, error)
- func NewName(commonName, country, org string) pkix.Name
- func ReadCertFromFile(name string) (*x509.Certificate, error)
- func ReadKeyFromFile(name string) (*ed25519.PrivateKey, error)
- func SaveCertToFile(path, name string, cert *x509.Certificate) error
- func SaveKeyToFile(path, name string, key ed25519.PrivateKey) error
- func SaveRequest(path, name string, csr *x509.CertificateRequest) error
- func SelfSignedCA(key ed25519.PrivateKey, req *x509.CertificateRequest, days int) (*x509.Certificate, error)
- type Key
Constants ¶
const ( // CERTTIFICATE_VALIDITY duration of certificate validity in days CERTIFICATE_VALIDITY = 365 // SERVER_KEY_NAME - name of server cert private key SERVER_KEY_NAME = "server.key" // ROOT_KEY_NAME - name of root cert private key ROOT_KEY_NAME = "root.key" // SERVER_PEM_NAME - name of server pem SERVER_PEM_NAME = "server.pem" // ROOT_PEM_NAME - name of root pem ROOT_PEM_NAME = "root.pem" // SERVER_CLIENT_PEM - the name of server client cert SERVER_CLIENT_PEM = "serverclient.pem" // SERVER_CLIENT_KEY - the name of server client key SERVER_CLIENT_KEY = "serverclient.key" // SERVER_CLIENT_ENTRY - the server client cert key for DB SERVER_CLIENT_ENTRY = "servercliententry" )
Variables ¶
This section is empty.
Functions ¶
func NewCSR ¶
func NewCSR(key ed25519.PrivateKey, name pkix.Name) (*x509.CertificateRequest, error)
NewCSR creates a new certificate signing request for a
func NewEndEntityCert ¶
func NewEndEntityCert(key ed25519.PrivateKey, req *x509.CertificateRequest, parent *x509.Certificate, days int) (*x509.Certificate, error)
NewEndEntityCert issues a new certificate from a parent certificate authority
func ReadCertFromFile ¶
func ReadCertFromFile(name string) (*x509.Certificate, error)
ReadCertFromFile reads a certificate from disk
func ReadKeyFromFile ¶
func ReadKeyFromFile(name string) (*ed25519.PrivateKey, error)
ReadKeyFromFile reads a private key (ed25519) from disk
func SaveCertToFile ¶
func SaveCertToFile(path, name string, cert *x509.Certificate) error
SaveCertToFile save a certificate to the specified path
func SaveKeyToFile ¶
func SaveKeyToFile(path, name string, key ed25519.PrivateKey) error
SaveKeyToFile save a private key (ed25519) to the certs database
func SaveRequest ¶
func SaveRequest(path, name string, csr *x509.CertificateRequest) error
SaveRequest saves a certificate request to the specified path
func SelfSignedCA ¶
func SelfSignedCA(key ed25519.PrivateKey, req *x509.CertificateRequest, days int) (*x509.Certificate, error)
SelfSignedCA returns a new self-signed certificate
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the struct for an edwards representation point
func (*Key) Curve25519PrivateKey ¶
Key.Curve25519PrivateKey returns the private key in Montogomery form used for ECDH.
func (*Key) Ed25519PrivateKey ¶
func (n *Key) Ed25519PrivateKey() (ed25519.PrivateKey, error)
Key.Ed25519PrivateKey returns the private key in Edwards form used for EdDSA.