webcrypto

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAESCBC

func DecryptAESCBC(reader io.Reader, privateKey *rsa.PrivateKey, encryptedKeyFile string) (io.ReadCloser, error)

Decrypts a file encrypted with AES (key length depends on input) in CBC block chaining mode and PKCS#7 padding. The provided key must be encoded in base16, and the first block of the input is the IV. The output is a pipe reader that can be used to stream the decrypted file.

func DecryptAESCBCWithIV

func DecryptAESCBCWithIV(reader io.ReadCloser, privateKey *rsa.PrivateKey, encryptedKeyB64 string, iv []byte) (io.ReadCloser, error)

func LoadPrivateKey added in v0.11.0

func LoadPrivateKey(privateKeyBase64 string) (*rsa.PrivateKey, error)

func ValidateKeyPair added in v0.11.0

func ValidateKeyPair(pub string, privkey rsa.PrivateKey) (bool, error)

Types

type DecryptionKeys added in v0.11.0

type DecryptionKeys struct {
	DecryptKey   *rsa.PrivateKey
	EncryptedKey string
}

Jump to

Keyboard shortcuts

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