代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package accesscontrol
// CA defines a certificate authority that can generate
// certificates signed by it
type CA interface {
// CertBytes returns the certificate of the CA in PEM encoding
CertBytes() []byte
// newCertKeyPair returns a certificate and private key pair and nil,
// or nil, error in case of failure
// The certificate is signed by the CA
newCertKeyPair() (*certKeyPair, error)
}
type ca struct {
caCert *certKeyPair
}
func NewCA() (CA, error) {
c := &ca{}
var err error
c.caCert, err = newCertKeyPair(true, nil, nil)
if err != nil {
return nil, err
}
return c, nil
}
// CertBytes returns the certificate of the CA in PEM encoding
func (c *ca) CertBytes() []byte {
return c.caCert.certBytes
}
// newCertKeyPair returns a certificate and private key pair and nil,
// or nil, error in case of failure
// The certificate is signed by the CA
func (c *ca) newCertKeyPair() (*certKeyPair, error) {
return newCertKeyPair(false, c.caCert.Signer, c.caCert.cert)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。