Documentation ¶
Overview ¶
Package x509 provides a mockable wrapper for crypto/x509.
Index ¶
- type Impl
- func (*Impl) CreateCertificate(rand io.Reader, template *x509.Certificate, parent *x509.Certificate, pub any, ...) ([]byte, error)
- func (*Impl) CreateCertificateRequest(rand io.Reader, template *x509.CertificateRequest, priv any) (csr []byte, err error)
- func (*Impl) CreateRevocationList(rand io.Reader, template *x509.RevocationList, issuer *x509.Certificate, ...) ([]byte, error)
- func (*Impl) DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error)
- func (*Impl) EncryptPEMBlock(rand io.Reader, blockType string, data []byte, password []byte, ...) (*pem.Block, error)
- func (*Impl) IsEncryptedPEMBlock(b *pem.Block) bool
- func (*Impl) MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)
- func (*Impl) MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte
- func (*Impl) MarshalPKCS1PublicKey(key *rsa.PublicKey) []byte
- func (*Impl) MarshalPKCS8PrivateKey(key any) ([]byte, error)
- func (*Impl) MarshalPKIXPublicKey(pub any) ([]byte, error)
- func (*Impl) NewCertPool() *x509.CertPool
- func (*Impl) ParseCRL(crlBytes []byte) (*pkix.CertificateList, error)
- func (*Impl) ParseCertificate(der []byte) (*x509.Certificate, error)
- func (*Impl) ParseCertificateRequest(asn1Data []byte) (*x509.CertificateRequest, error)
- func (*Impl) ParseCertificates(der []byte) ([]*x509.Certificate, error)
- func (*Impl) ParseDERCRL(derBytes []byte) (*pkix.CertificateList, error)
- func (*Impl) ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)
- func (*Impl) ParsePKCS1PrivateKey(der []byte) (*rsa.PrivateKey, error)
- func (*Impl) ParsePKCS1PublicKey(der []byte) (*rsa.PublicKey, error)
- func (*Impl) ParsePKCS8PrivateKey(der []byte) (key any, err error)
- func (*Impl) ParsePKIXPublicKey(derBytes []byte) (pub any, err error)
- func (*Impl) SystemCertPool() (*x509.CertPool, error)
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) CreateCertificate ¶
func (*Impl) CreateCertificateRequest ¶
func (*Impl) CreateRevocationList ¶
func (*Impl) DecryptPEMBlock ¶
func (*Impl) EncryptPEMBlock ¶
func (*Impl) MarshalECPrivateKey ¶
func (*Impl) MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)
func (*Impl) MarshalPKCS1PrivateKey ¶
func (*Impl) MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte
func (*Impl) NewCertPool ¶
func (*Impl) ParseCertificate ¶
func (*Impl) ParseCertificate(der []byte) (*x509.Certificate, error)
func (*Impl) ParseCertificateRequest ¶
func (*Impl) ParseCertificateRequest(asn1Data []byte) (*x509.CertificateRequest, error)
func (*Impl) ParseCertificates ¶
func (*Impl) ParseCertificates(der []byte) ([]*x509.Certificate, error)
func (*Impl) ParseDERCRL ¶
func (*Impl) ParseDERCRL(derBytes []byte) (*pkix.CertificateList, error)
func (*Impl) ParseECPrivateKey ¶
func (*Impl) ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)
func (*Impl) ParsePKCS1PrivateKey ¶
func (*Impl) ParsePKCS1PrivateKey(der []byte) (*rsa.PrivateKey, error)
func (*Impl) ParsePKCS1PublicKey ¶
func (*Impl) ParsePKCS8PrivateKey ¶
func (*Impl) ParsePKIXPublicKey ¶
type Interface ¶
type Interface interface { CreateCertificate(rand io.Reader, template *x509.Certificate, parent *x509.Certificate, pub any, priv any) ([]byte, error) CreateCertificateRequest(rand io.Reader, template *x509.CertificateRequest, priv any) (csr []byte, err error) CreateRevocationList(rand io.Reader, template *x509.RevocationList, issuer *x509.Certificate, priv crypto.Signer) ([]byte, error) DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error) EncryptPEMBlock(rand io.Reader, blockType string, data []byte, password []byte, alg x509.PEMCipher) (*pem.Block, error) IsEncryptedPEMBlock(b *pem.Block) bool MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error) MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte MarshalPKCS1PublicKey(key *rsa.PublicKey) []byte MarshalPKCS8PrivateKey(key any) ([]byte, error) MarshalPKIXPublicKey(pub any) ([]byte, error) NewCertPool() *x509.CertPool ParseCRL(crlBytes []byte) (*pkix.CertificateList, error) ParseCertificate(der []byte) (*x509.Certificate, error) ParseCertificateRequest(asn1Data []byte) (*x509.CertificateRequest, error) ParseCertificates(der []byte) ([]*x509.Certificate, error) ParseDERCRL(derBytes []byte) (*pkix.CertificateList, error) ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error) ParsePKCS1PrivateKey(der []byte) (*rsa.PrivateKey, error) ParsePKCS1PublicKey(der []byte) (*rsa.PublicKey, error) ParsePKCS8PrivateKey(der []byte) (key any, err error) ParsePKIXPublicKey(derBytes []byte) (pub any, err error) SystemCertPool() (*x509.CertPool, error) }
Click to show internal directories.
Click to hide internal directories.