logmower-shipper/vendor/github.com/youmark/pkcs8
rasmus e45bf4739b go mod vendor
+ move k8s.io/apimachinery fork from go.work to go.mod
(and include it in vendor)
2022-11-07 00:26:05 +02:00
..
.gitignore go mod vendor 2022-11-07 00:26:05 +02:00
.travis.yml go mod vendor 2022-11-07 00:26:05 +02:00
cipher_3des.go go mod vendor 2022-11-07 00:26:05 +02:00
cipher_aes.go go mod vendor 2022-11-07 00:26:05 +02:00
cipher.go go mod vendor 2022-11-07 00:26:05 +02:00
kdf_pbkdf2.go go mod vendor 2022-11-07 00:26:05 +02:00
kdf_scrypt.go go mod vendor 2022-11-07 00:26:05 +02:00
LICENSE go mod vendor 2022-11-07 00:26:05 +02:00
pkcs8.go go mod vendor 2022-11-07 00:26:05 +02:00
README go mod vendor 2022-11-07 00:26:05 +02:00
README.md go mod vendor 2022-11-07 00:26:05 +02:00

pkcs8

OpenSSL can generate private keys in both "traditional format" and PKCS#8 format. Newer applications are advised to use more secure PKCS#8 format. Go standard crypto package provides a function to parse private key in PKCS#8 format. There is a limitation to this function. It can only handle unencrypted PKCS#8 private keys. To use this function, the user has to save the private key in file without encryption, which is a bad practice to leave private keys unprotected on file systems. In addition, Go standard package lacks the functions to convert RSA/ECDSA private keys into PKCS#8 format.

pkcs8 package fills the gap here. It implements functions to process private keys in PKCS#8 format, as defined in RFC5208 and RFC5958. It can handle both unencrypted PKCS#8 PrivateKeyInfo format and EncryptedPrivateKeyInfo format with PKCS#5 (v2.0) algorithms.

Godoc

Installation

Supports Go 1.10+. Release v1.1 is the last release supporting Go 1.9

go get github.com/youmark/pkcs8

dependency

This package depends on golang.org/x/crypto/pbkdf2 and golang.org/x/crypto/scrypt packages. Use the following command to retrieve them

go get golang.org/x/crypto/pbkdf2
go get golang.org/x/crypto/scrypt