newcryptosm

package module
v0.0.0-...-edb949a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 9

README

cryptogm

基于go语言的crypto包 包含支持兼容国密的tls x509以及国密算法 此版本的tls版本仅支持1.2以下

使用方法

跟原先使用方法雷同

注:仅只能用于个人,不可商用

Documentation

Overview

Package newcryptosm Package x509 Package crypto collects common cryptographic constants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHash

func RegisterHash(h Hash, f func() hash.Hash)

RegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions.

Types

type Hash

type Hash uint

Hash identifies a cryptographic hash function that is implemented in another package.

const (
	MD4         Hash = 1 + iota // import golang.org/x/crypto/md4
	MD5                         // import crypto/md5
	SHA1                        // import crypto/sha1
	SHA224                      // import crypto/sha256
	SHA256                      // import crypto/sha256
	SHA384                      // import crypto/sha512
	SHA512                      // import crypto/sha512
	MD5SHA1                     // no implementation; MD5+SHA1 used for TLS RSA
	RIPEMD160                   // import golang.org/x/crypto/ripemd160
	SHA3_224                    // import golang.org/x/crypto/sha3
	SHA3_256                    // import golang.org/x/crypto/sha3
	SHA3_384                    // import golang.org/x/crypto/sha3
	SHA3_512                    // import golang.org/x/crypto/sha3
	SHA512_224                  // import crypto/sha512
	SHA512_256                  // import crypto/sha512
	BLAKE2s_256                 // import golang.org/x/crypto/blake2s
	BLAKE2b_256                 // import golang.org/x/crypto/blake2b
	BLAKE2b_384                 // import golang.org/x/crypto/blake2b
	BLAKE2b_512                 // import golang.org/x/crypto/blake2b
	SM3
)

func (Hash) Available

func (h Hash) Available() bool

Available reports whether the given hash function is linked into the binary.

func (Hash) HashFunc

func (h Hash) HashFunc() crypto.Hash

HashFunc simply returns the value of h so that Hash implements SignerOpts.

func (Hash) New

func (h Hash) New() hash.Hash

New returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary.

func (Hash) Size

func (h Hash) Size() int

Size returns the length, in bytes, of a digest resulting from the given hash function. It doesn't require that the hash function in question be linked into the program.

Directories

Path Synopsis
Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-3.
Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-3.
Package http provides HTTP client and server implementations.
Package http provides HTTP client and server implementations.
cgi
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
cookiejar
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
fcgi
Package fcgi implements the FastCGI protocol.
Package fcgi implements the FastCGI protocol.
httptest
Package httptest provides utilities for HTTP testing.
Package httptest provides utilities for HTTP testing.
httptrace
Package httptrace provides mechanisms to trace the events within HTTP client requests.
Package httptrace provides mechanisms to trace the events within HTTP client requests.
httputil
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
internal
Package internal contains HTTP internals shared by net/http and net/http/httputil.
Package internal contains HTTP internals shared by net/http and net/http/httputil.
internal/nettrace
Package nettrace contains internal hooks for tracing activity in the net package.
Package nettrace contains internal hooks for tracing activity in the net package.
pprof
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
Package sm9 implements a particular bilinear group at the 128-bit security level.
Package sm9 implements a particular bilinear group at the 128-bit security level.
tls
Package gmtls add sm2 support
Package gmtls add sm2 support
credentials/echo
Package echo is a generated protocol buffer package.
Package echo is a generated protocol buffer package.
Package x509 parses X.509-encoded keys and certificates.
Package x509 parses X.509-encoded keys and certificates.
pkix
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL