mirror of
https://github.com/smallstep/certificates.git
synced 2024-11-15 18:12:59 +00:00
Add method to create a CertificateAuthorityResponse.
This commit is contained in:
parent
a3f729fc28
commit
fcaaab94a4
12
pki/pki.go
12
pki/pki.go
@ -376,6 +376,18 @@ func (p *PKI) WriteIntermediateCertificate(crt *x509.Certificate, key interface{
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateCertificateAuthorityResponse returns a
|
||||||
|
// CreateCertificateAuthorityResponse that can be used as a parent of a
|
||||||
|
// CreateCertificateAuthority request.
|
||||||
|
func (p *PKI) CreateCertificateAuthorityResponse(cert *x509.Certificate, key crypto.PrivateKey) *apiv1.CreateCertificateAuthorityResponse {
|
||||||
|
signer, _ := key.(crypto.Signer)
|
||||||
|
return &apiv1.CreateCertificateAuthorityResponse{
|
||||||
|
Certificate: cert,
|
||||||
|
PrivateKey: key,
|
||||||
|
Signer: signer,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GetCertificateAuthority attempts to load the certificate authority from the
|
// GetCertificateAuthority attempts to load the certificate authority from the
|
||||||
// RA.
|
// RA.
|
||||||
func (p *PKI) GetCertificateAuthority() error {
|
func (p *PKI) GetCertificateAuthority() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user