Pass the certifer instance through the cert chain
This commit is contained in:
parent
4e2f5f197f
commit
c2efcc443a
3
cert.go
3
cert.go
|
@ -54,6 +54,7 @@ func (x *certifier) NewCA() (*Cert, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Cert{
|
return &Cert{
|
||||||
|
x: x,
|
||||||
Template: ca,
|
Template: ca,
|
||||||
Bytes: caBytes,
|
Bytes: caBytes,
|
||||||
Key: NewKeyParameters(pk),
|
Key: NewKeyParameters(pk),
|
||||||
|
@ -93,6 +94,7 @@ func (c *Cert) NewCert(cn string) (*Cert, error) {
|
||||||
ca = c
|
ca = c
|
||||||
}
|
}
|
||||||
return &Cert{
|
return &Cert{
|
||||||
|
x: c.x,
|
||||||
Template: cert,
|
Template: cert,
|
||||||
Bytes: certBytes,
|
Bytes: certBytes,
|
||||||
Key: NewKeyParameters(pk),
|
Key: NewKeyParameters(pk),
|
||||||
|
@ -143,6 +145,7 @@ func (c *Cert) WithoutParentKeys() *Cert {
|
||||||
ca.WithoutKeys()
|
ca.WithoutKeys()
|
||||||
}
|
}
|
||||||
return &Cert{
|
return &Cert{
|
||||||
|
x: c.x,
|
||||||
Template: c.Template,
|
Template: c.Template,
|
||||||
Bytes: c.Bytes,
|
Bytes: c.Bytes,
|
||||||
Key: c.Key,
|
Key: c.Key,
|
||||||
|
|
|
@ -52,6 +52,7 @@ func (x *certifier) Import(data []byte) (*Cert, error) {
|
||||||
if err := tGob.Decode(cert); err != nil {
|
if err := tGob.Decode(cert); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
cert.x = x
|
||||||
return cert, nil
|
return cert, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user