Documentation ¶
Index ¶
- Variables
- func Base64Decode(s string) ([]byte, error)
- func Base64Encode(src []byte) string
- func BytesPadding(text []byte, size int) []byte
- func BytesSplit(buf []byte, size int) [][]byte
- func BytesToString(buf []byte) string
- func CryptoHashSum(typ string, slices ...[]byte) ([]byte, error)
- func EncodeDerToPem(data []byte, blockType string) []byte
- func GenRandom(n int) ([]byte, error)
- func GetBlockTypeFromName(name string) string
- func GetCryptoHash(typ string) (crypto.Hash, error)
- func HashNames() []string
- func HashSum(typ string, slices ...[]byte) ([]byte, error)
- func HexDecode(s string) ([]byte, error)
- func HexEncode(src []byte) string
- func HexPadding(text string, size int) string
- func ParsePemToDer(data []byte) ([]byte, error)
- func StringToBytes(str string) []byte
- type Block
- type Cipher
- type CipherFunc
- type CipherFuncMap
- type Encoding
- func (this *Encoding) Base64Decode(s string) ([]byte, error)
- func (this *Encoding) Base64Encode(src []byte) string
- func (this *Encoding) BytesPadding(text []byte, size int) []byte
- func (this *Encoding) HexDecode(s string) ([]byte, error)
- func (this *Encoding) HexEncode(src []byte) string
- func (this *Encoding) HexPadding(text string, size int) string
- type Hash
- type HashFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 编码 // Encode(out io.Writer, b *Block) error Encode = pem.Encode // 编码 // EncodeToMemory(b *Block) []byte EncodeToMemory = pem.EncodeToMemory // 解码 // Decode(data []byte) (p *Block, rest []byte) Decode = pem.Decode )
View Source
var PemBlockTypeMap = map[string]string{
"pri_key": "PRIVATE KEY",
"en_pri_key": "ENCRYPTED PRIVATE KEY",
"pub_key": "PUBLIC KEY",
"ec_pri_key": "EC PRIVATE KEY",
"dsa_pri_key": "DSA PRIVATE KEY",
"rsa_pri_key": "RSA PRIVATE KEY",
}
BlockType 列表
Functions ¶
func Base64Decode ¶ added in v1.0.2002
func Base64Encode ¶ added in v1.0.2002
func BytesPadding ¶ added in v1.0.2039
func CryptoHashSum ¶ added in v1.0.2003
签名后数据
func EncodeDerToPem ¶ added in v1.0.1033
der 证书编码为 pem 证书
func GetBlockTypeFromName ¶ added in v1.0.1033
获取 BlockType 类型
func HexPadding ¶ added in v1.0.2002
func ParsePemToDer ¶ added in v1.0.1033
解析 pem 证书为 der 证书
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
*
- 加密方式 *
- @create 2022-7-26
- @author deatil
type Encoding ¶
type Encoding struct{}
*
- 编码 *
- @create 2022-4-17
- @author deatil
func (*Encoding) Base64Decode ¶
Base64 解码
func (*Encoding) BytesPadding ¶ added in v1.0.2048
BytesPadding
Click to show internal directories.
Click to hide internal directories.