pkcs8

package
v1.0.1017 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

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 AddOidAsn1

func AddOidAsn1(name string, identifier asn1.ObjectIdentifier)

添加 oidAsn1

func AddOidHash

func AddOidHash(name string, value func() hash.Hash)

添加 oidHash

func AddRfc1423Algo

func AddRfc1423Algo(value rfc1423Algo)

添加 rfc1423Algo

func AppendOID

func AppendOID(b asn1.ObjectIdentifier, v ...int) asn1.ObjectIdentifier

最加数据为新的 Identifier

func DecryptPEMBlock

func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error)

解出 PEM 块

func DecryptPKCS8PrivateKey

func DecryptPKCS8PrivateKey(data, password []byte) ([]byte, error)

解出 PKCS8 密钥 加密方式: AES-128-CBC | AES-192-CBC | AES-256-CBC | DES | 3DES

func EncryptPKCS8PrivateKey

func EncryptPKCS8PrivateKey(
	rand io.Reader,
	blockType string,
	data []byte,
	password []byte,
	alg x509.PEMCipher,
	opts ...any,
) (*pem.Block, error)

加密 PKCS8

Types

type Opts

type Opts struct {
	SaltSize       int
	IterationCount int
	HMACHash       string
}

配置

Jump to

Keyboard shortcuts

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