pkcs7

package
v0.0.0-...-0fefa07 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Encrypter = "PKCS7"

Variables

This section is empty.

Functions

This section is empty.

Types

type PKCS7Encrypter

type PKCS7Encrypter struct {
	// contains filtered or unexported fields
}

func New

func New(key *PrivateKey, cert *PublicKey) *PKCS7Encrypter

func (*PKCS7Encrypter) Decrypt

func (e *PKCS7Encrypter) Decrypt(data crypto.Data) (crypto.Data, error)

func (*PKCS7Encrypter) Encrypt

func (e *PKCS7Encrypter) Encrypt(data crypto.Data) (crypto.Data, error)

func (*PKCS7Encrypter) GenerateSecrets

func (p *PKCS7Encrypter) GenerateSecrets(force bool, ctx context.Context) error

type PKCS7Plugin

type PKCS7Plugin struct {
	PrivateKey string `kong:"help='Path to private key',type='path',placeholder='FILE'"`
	PublicKey  string `kong:"help='Path to public key',type='path',placeholder='FILE'"`
	Subject    string `kong:"help='Subject to use for certificate when creating keys',default='/'"`
	Digest     string `kong:"help='Hash function used for PKCS7',enum='SHA256,SHA384,SHA512',default='SHA256'"`
	Keysize    uint32 `kong:"help='Key size used for encryption',default='2048'"`
}

func (*PKCS7Plugin) Encrypter

func (o *PKCS7Plugin) Encrypter() string

func (*PKCS7Plugin) NewEncrypter

func (o *PKCS7Plugin) NewEncrypter(baseDir string) *PKCS7Encrypter

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func NewPrivateKey

func NewPrivateKey(path string, bits uint32) *PrivateKey

func (*PrivateKey) Bits

func (k *PrivateKey) Bits() uint32

func (*PrivateKey) Generate

func (k *PrivateKey) Generate() (*rsa.PrivateKey, error)

func (*PrivateKey) Load

func (k *PrivateKey) Load() (*rsa.PrivateKey, error)

func (*PrivateKey) Path

func (k *PrivateKey) Path() string

func (*PrivateKey) Save

func (k *PrivateKey) Save(key *rsa.PrivateKey, force bool) error

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(path, subject string, algo x509.SignatureAlgorithm) *PublicKey

func (*PublicKey) Generate

func (k *PublicKey) Generate(key *rsa.PrivateKey) (*x509.Certificate, error)

func (*PublicKey) Load

func (k *PublicKey) Load() (*x509.Certificate, error)

func (*PublicKey) Path

func (k *PublicKey) Path() string

func (*PublicKey) Save

func (k *PublicKey) Save(cert *x509.Certificate, force bool) error

func (*PublicKey) SignatureAlgorithm

func (k *PublicKey) SignatureAlgorithm() x509.SignatureAlgorithm

func (*PublicKey) Subject

func (k *PublicKey) Subject() string

Jump to

Keyboard shortcuts

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