Documentation
¶
Index ¶
- Constants
- func EncodePemCSR(csr *x509.CertificateRequest) []byte
- func EncodePemCSRWithRaw(raw []byte) []byte
- func EncodePemCert(cert *x509.Certificate) []byte
- func EncodePemCertWithRaw(raw []byte) []byte
- func EncodePemPrivKey(privateKey crypto.Signer) []byte
- func EncodePemPrivKeyWithRaw(raw []byte) []byte
- type CertOptions
- type Signer
Constants ¶
View Source
const ( // CertificateBlockType is a possible value for pem.Block.Type. CertificateBlockType = "CERTIFICATE" // CertificateRequestBlockType is a possible value for pem.Block.Type. CertificateRequestBlockType = "CERTIFICATE REQUEST" // PrivateKeyBlockType is a possible value for pem.Block.Type. PrivateKeyBlockType = "PRIVATE KEY" )
Variables ¶
This section is empty.
Functions ¶
func EncodePemCSR ¶
func EncodePemCSR(csr *x509.CertificateRequest) []byte
func EncodePemCSRWithRaw ¶
func EncodePemCert ¶
func EncodePemCert(cert *x509.Certificate) []byte
func EncodePemCertWithRaw ¶
func EncodePemPrivKey ¶
func EncodePemPrivKeyWithRaw ¶
Types ¶
type CertOptions ¶
CertOptions contains options for generating a new certificate.
type Signer ¶
type Signer interface { // GenCSR generate CERTIFICATE REQUEST GenCSR(opts *CertOptions) (csrRaw []byte, err error) // GenCert generate CERTIFICATE GenCert(opts *CertOptions) (certRaw []byte, err error) // Sign use self sign csr, return new cert, must invoke GenCert first, otherwise return error Sign(csrRaw []byte, expireTime time.Duration) (certRaw []byte, err error) // PrivateKey get PRIVATE KEY PrivateKey() []byte }
func NewSelfSigner ¶
Click to show internal directories.
Click to hide internal directories.