Documentation ¶
Overview ¶
Package crypto collects common cryptographic constants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlgoCapacity ¶
type AlgoCapacity interface {
// contains filtered or unexported methods
}
type Context ¶
type Context interface { // ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form. // // It returns a *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, // ed25519.PublicKey or *sm.PublicKey. More types might be supported in the future. // // This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY". ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error) // MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form. // // The following key types are currently supported: *rsa.PublicKey, *ecdsa.PublicKey, // ed25519.PublicKey and *sm2.PublicKey. Unsupported key types result in an error. // // This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY". MarshalPKIXPublicKey(pub interface{}) ([]byte, error) // CreateCertificateRequest creates a new certificate request based on a template. CreateCertificateRequest(rand io.Reader, template *x.CertificateRequest, priv interface{}) (csr []byte, err error) // ParseCertificateRequest parses a single certificate request from the // given ASN.1 DER data. ParseCertificateRequest(asn1Data []byte) (*x.CertificateRequest, error) // CheckCertificateRequestSignature reports whether the signature on c is valid. CheckCertificateRequestSignature(c *x.CertificateRequest) error // CreateCertificate creates a new X.509v3 certificate based on a template. CreateCertificate(rand io.Reader, template, parent *x.Certificate, pub, priv interface{}) (cert []byte, err error) // ParseCertificate parses a single certificate from the given ASN.1 DER data. ParseCertificate(asn1Data []byte) (*x.Certificate, error) ParseCertificates(asn1Data []byte) ([]*x.Certificate, error) // CheckCertSignature verifies that signature is a valid signature over signed from // cert's public key. CheckCertSignature(cert *x.Certificate, algo x.SignatureAlgorithm, signed, signature []byte) error // CheckCertSignatureFrom verifies that the signature on cert is a valid signature // from parent. CheckCertSignatureFrom(cert *x.Certificate, parent *x.Certificate) error // WARNING: this function doesn't do any revocation checking. Verify(c *x.Certificate, opts x.VerifyOptions) (chains [][]*x.Certificate, err error) CheckCRLSignature(cert *x.Certificate, crl *pkix.CertificateList) error // CreateCRL returns a DER encoded CRL, signed by this Certificate, that // contains the given list of revoked certificates. CreateCRL(cert *x.Certificate, rand io.Reader, priv interface{}, revokedCerts []pkix.RevokedCertificate, now, expiry time.Time) (crlBytes []byte, err error) }
var X509Instance Context
type Hash ¶
type Hash uint
Hash identifies a cryptographic hash function that is implemented in another package.
func (Hash) Available ¶
Available reports whether the given hash function is linked into the binary.
Click to show internal directories.
Click to hide internal directories.