Documentation
¶
Index ¶
- Constants
- Variables
- func AddOidAsn1(name string, identifier asn1.ObjectIdentifier)
- func AddOidHash(name string, value func() hash.Hash)
- func AddRfc1423Algo(value rfc1423Algo)
- func AppendOID(b asn1.ObjectIdentifier, v ...int) asn1.ObjectIdentifier
- func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error)
- func DecryptPKCS8PrivateKey(data, password []byte) ([]byte, error)
- func EncryptPKCS8PrivateKey(rand io.Reader, blockType string, data []byte, password []byte, ...) (*pem.Block, error)
- type Opts
Constants ¶
View Source
const PBKDF2Iterations = 10000
PBKDF2Iterations is the default number of iterations for PBKDF2, 100k iterations. Nist recommends at least 10k, 1Passsword uses 100k.
View Source
const PBKDF2SaltSize = 16
PBKDF2SaltSize is the default size of the salt for PBKDF2, 128-bit salt.
Variables ¶
View Source
var DefaultOpts = &Opts{ SaltSize: PBKDF2SaltSize, IterationCount: PBKDF2Iterations, HMACHash: "SHA256", }
默认配置
Functions ¶
func AppendOID ¶
func AppendOID(b asn1.ObjectIdentifier, v ...int) asn1.ObjectIdentifier
最加数据为新的 Identifier
func DecryptPEMBlock ¶
解出 PEM 块
func DecryptPKCS8PrivateKey ¶
解出 PKCS8 密钥 加密方式: AES-128-CBC | AES-192-CBC | AES-256-CBC | DES | 3DES
Types ¶
Click to show internal directories.
Click to hide internal directories.