expose type cast method

This commit is contained in:
Emman 2022-04-13 09:41:38 +08:00
parent 51f29b0258
commit db4ee8585a

View File

@ -555,6 +555,10 @@ func (c *Certificate) asX509() *x509.Certificate {
return (*x509.Certificate)(c) return (*x509.Certificate)(c)
} }
func (c *Certificate) ToX509() *x509.Certificate {
return c.asX509()
}
func (c *Certificate) Equal(other *Certificate) bool { func (c *Certificate) Equal(other *Certificate) bool {
if c == nil || other == nil { if c == nil || other == nil {
return c == other return c == other
@ -1491,6 +1495,10 @@ func (c *CertificateRequest) asX509() *x509.CertificateRequest {
return (*x509.CertificateRequest)(c) return (*x509.CertificateRequest)(c)
} }
func (c *CertificateRequest) ToX509() *x509.CertificateRequest {
return c.asX509()
}
// These structures reflect the ASN.1 structure of X.509 certificate // These structures reflect the ASN.1 structure of X.509 certificate
// signature requests (see RFC 2986): // signature requests (see RFC 2986):