Versions in this module Expand all Collapse all v1 v1.0.1 Jun 29, 2022 Changes in this version + var ErrUnsupportedAlgorithm = errors.New("x509: cannot verify signature: algorithm unimplemented") + var IncorrectPasswordError = errors.New("x509: decryption password incorrect") + func CreateCertificate(rand io.Reader, template, parent *Certificate, pub interface{}, ...) (cert []byte, err error) + func DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error) + func EncryptPEMBlock(rand io.Reader, blockType string, data, password []byte, alg PEMCipher) (*pem.Block, error) + func IsEncryptedPEMBlock(b *pem.Block) bool + func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error) + func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte + func MarshalPKIXPublicKey(pub interface{}) ([]byte, error) + func ParseCRL(crlBytes []byte) (certList *pkix.CertificateList, err error) + func ParseDERCRL(derBytes []byte) (certList *pkix.CertificateList, err error) + func ParseECPrivateKey(der []byte) (key *ecdsa.PrivateKey, err error) + func ParsePKCS1PrivateKey(der []byte) (key *rsa.PrivateKey, err error) + func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error) + func ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error) + type CertPool struct + func NewCertPool() *CertPool + func (s *CertPool) AddCert(cert *Certificate) + func (s *CertPool) AppendCertsFromPEM(pemCerts []byte) (ok bool) + func (s *CertPool) Subjects() (res [][]byte) + type Certificate struct + AuthorityKeyId []byte + BasicConstraintsValid bool + CRLDistributionPoints []string + DNSNames []string + EmailAddresses []string + ExtKeyUsage []ExtKeyUsage + Extensions []pkix.Extension + ExtraExtensions []pkix.Extension + IPAddresses []net.IP + IsCA bool + IsPrecert bool + Issuer pkix.Name + IssuingCertificateURL []string + KeyUsage KeyUsage + MaxPathLen int + NotAfter time.Time + NotBefore time.Time + OCSPServer []string + PermittedDNSDomains []string + PermittedDNSDomainsCritical bool + PolicyIdentifiers []asn1.ObjectIdentifier + PublicKey interface{} + PublicKeyAlgorithm PublicKeyAlgorithm + Raw []byte + RawIssuer []byte + RawSubject []byte + RawSubjectPublicKeyInfo []byte + RawTBSCertificate []byte + SerialNumber *big.Int + Signature []byte + SignatureAlgorithm SignatureAlgorithm + Subject pkix.Name + SubjectKeyId []byte + UnknownExtKeyUsage []asn1.ObjectIdentifier + Version int + func ParseCertificate(asn1Data []byte) (*Certificate, error) + func ParseCertificates(asn1Data []byte) ([]*Certificate, error) + func ParseTBSCertificate(asn1Data []byte) (*Certificate, error) + func (c *Certificate) CheckCRLSignature(crl *pkix.CertificateList) (err error) + func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature []byte) (err error) + func (c *Certificate) CheckSignatureFrom(parent *Certificate) (err error) + func (c *Certificate) CreateCRL(rand io.Reader, priv interface{}, revokedCerts []pkix.RevokedCertificate, ...) (crlBytes []byte, err error) + func (c *Certificate) Equal(other *Certificate) bool + func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err error) + func (c *Certificate) VerifyHostname(h string) error + type CertificateInvalidError struct + Cert *Certificate + Reason InvalidReason + func (e CertificateInvalidError) Error() string + type ConstraintViolationError struct + func (ConstraintViolationError) Error() string + type ExtKeyUsage int + const ExtKeyUsageAny + const ExtKeyUsageClientAuth + const ExtKeyUsageCodeSigning + const ExtKeyUsageEmailProtection + const ExtKeyUsageIPSECEndSystem + const ExtKeyUsageIPSECTunnel + const ExtKeyUsageIPSECUser + const ExtKeyUsageMicrosoftServerGatedCrypto + const ExtKeyUsageNetscapeServerGatedCrypto + const ExtKeyUsageOCSPSigning + const ExtKeyUsageServerAuth + const ExtKeyUsageTimeStamping + type HostnameError struct + Certificate *Certificate + Host string + func (h HostnameError) Error() string + type InvalidReason int + const CANotAuthorizedForThisName + const Expired + const IncompatibleUsage + const NotAuthorizedToSign + const TooManyIntermediates + type KeyUsage int + const KeyUsageCRLSign + const KeyUsageCertSign + const KeyUsageContentCommitment + const KeyUsageDataEncipherment + const KeyUsageDecipherOnly + const KeyUsageDigitalSignature + const KeyUsageEncipherOnly + const KeyUsageKeyAgreement + const KeyUsageKeyEncipherment + type NonFatalErrors struct + Errors []error + func (e *NonFatalErrors) AddError(err error) + func (e *NonFatalErrors) HasError() bool + func (e NonFatalErrors) Error() string + type PEMCipher int + const PEMCipher3DES + const PEMCipherAES128 + const PEMCipherAES192 + const PEMCipherAES256 + const PEMCipherDES + type PublicKeyAlgorithm int + const DSA + const ECDSA + const RSA + const UnknownPublicKeyAlgorithm + type SignatureAlgorithm int + const DSAWithSHA1 + const DSAWithSHA256 + const ECDSAWithSHA1 + const ECDSAWithSHA256 + const ECDSAWithSHA384 + const ECDSAWithSHA512 + const MD2WithRSA + const MD5WithRSA + const SHA1WithRSA + const SHA256WithRSA + const SHA384WithRSA + const SHA512WithRSA + const UnknownSignatureAlgorithm + type SystemRootsError struct + func (e SystemRootsError) Error() string + type UnhandledCriticalExtension struct + ID asn1.ObjectIdentifier + func (h UnhandledCriticalExtension) Error() string + type UnknownAuthorityError struct + func (e UnknownAuthorityError) Error() string + type VerifyOptions struct + CurrentTime time.Time + DNSName string + DisableTimeChecks bool + Intermediates *CertPool + KeyUsages []ExtKeyUsage + Roots *CertPool