From db4ee8585a63823e24c323f67809254cd03486f8 Mon Sep 17 00:00:00 2001 From: Emman Date: Wed, 13 Apr 2022 09:41:38 +0800 Subject: [PATCH] expose type cast method --- smx509/x509.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/smx509/x509.go b/smx509/x509.go index 947d9dd..62ff1a4 100644 --- a/smx509/x509.go +++ b/smx509/x509.go @@ -555,6 +555,10 @@ func (c *Certificate) asX509() *x509.Certificate { return (*x509.Certificate)(c) } +func (c *Certificate) ToX509() *x509.Certificate { + return c.asX509() +} + func (c *Certificate) Equal(other *Certificate) bool { if c == nil || other == nil { return c == other @@ -1491,6 +1495,10 @@ func (c *CertificateRequest) asX509() *x509.CertificateRequest { return (*x509.CertificateRequest)(c) } +func (c *CertificateRequest) ToX509() *x509.CertificateRequest { + return c.asX509() +} + // These structures reflect the ASN.1 structure of X.509 certificate // signature requests (see RFC 2986):