Documentation ¶
Index ¶
- func CertificateMatchesKey(certificate *x509.Certificate, publicKey crypto.PublicKey) (bool, error)
- func CreateCertificate(ctx context.Context, km keymanager.KeyManager, ...) (*x509.Certificate, error)
- func DERFromCertificates(certs []*x509.Certificate) (derBytes []byte)
- func GetSubjectKeyId(pubKey interface{}) ([]byte, error)
- type Keypair
- type MemoryKeypair
- type SerialNumber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateMatchesKey ¶
func CreateCertificate ¶
func CreateCertificate(ctx context.Context, km keymanager.KeyManager, template, parent *x509.Certificate, parentKeyId string, publicKey crypto.PublicKey) (*x509.Certificate, error)
func DERFromCertificates ¶
func DERFromCertificates(certs []*x509.Certificate) (derBytes []byte)
func GetSubjectKeyId ¶
GetSubjectKeyId calculates a subject key identifier by doing a SHA-1 hash over the ASN.1 encoding of the public key.
Types ¶
type Keypair ¶
type Keypair interface { // GetCertificate returns the keypair certificate. It is called for each // signing request. GetCertificate(ctx context.Context) (*x509.Certificate, error) // CreateCertificate signs a certificate with the keypair. CreateCertificate(ctx context.Context, template *x509.Certificate, publicKey interface{}) (certDER []byte, err error) }
type MemoryKeypair ¶
type MemoryKeypair struct {
// contains filtered or unexported fields
}
func NewMemoryKeypair ¶
func NewMemoryKeypair(cert *x509.Certificate, key crypto.PrivateKey) *MemoryKeypair
func (*MemoryKeypair) CreateCertificate ¶
func (m *MemoryKeypair) CreateCertificate(ctx context.Context, template *x509.Certificate, publicKey interface{}) ([]byte, error)
func (*MemoryKeypair) GetCertificate ¶
func (m *MemoryKeypair) GetCertificate(ctx context.Context) (*x509.Certificate, error)
type SerialNumber ¶
func NewSerialNumber ¶
func NewSerialNumber() SerialNumber
Click to show internal directories.
Click to hide internal directories.