Pass the certifer instance through the cert chain

This commit is contained in:
Thilo Karraß 2022-11-04 20:53:51 +01:00
parent 4e2f5f197f
commit c2efcc443a
2 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,7 @@ func (x *certifier) NewCA() (*Cert, error) {
}
return &Cert{
x: x,
Template: ca,
Bytes: caBytes,
Key: NewKeyParameters(pk),
@ -93,6 +94,7 @@ func (c *Cert) NewCert(cn string) (*Cert, error) {
ca = c
}
return &Cert{
x: c.x,
Template: cert,
Bytes: certBytes,
Key: NewKeyParameters(pk),
@ -143,6 +145,7 @@ func (c *Cert) WithoutParentKeys() *Cert {
ca.WithoutKeys()
}
return &Cert{
x: c.x,
Template: c.Template,
Bytes: c.Bytes,
Key: c.Key,

View File

@ -52,6 +52,7 @@ func (x *certifier) Import(data []byte) (*Cert, error) {
if err := tGob.Decode(cert); err != nil {
return nil, err
}
cert.x = x
return cert, nil
}