ciphersuite2

package
v0.0.0-...-e4cc500 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair(rand io.Reader, pk_algo string) (pub, priv []byte, err error)

func RegisterCipher

func RegisterCipher(str string, ciph Cipher_Driver)

func RegisterPkAlgo

func RegisterPkAlgo(str string, pka Pka_Driver)

Types

type Cipher_Buffer

type Cipher_Buffer struct {
	Key []byte
	IV  []byte
}

type Cipher_Driver

type Cipher_Driver interface {
	Keybuf() *Cipher_Buffer
	Encrypt(b *Cipher_Buffer) (*format2.CipherObject, error)
	Decrypt(b *Cipher_Buffer) (*format2.CipherObject, error)
}

type DecryptionContext

type DecryptionContext struct {
	KeyRing  KeyRing
	KeyRing2 KeyRing2
}

func Decrypt

func Decrypt(kr KeyRing) *DecryptionContext

Non-Wrapped only.

func Decrypt2

func Decrypt2(kr KeyRing2) *DecryptionContext

Wrapped only.

func (*DecryptionContext) StartDecryption

func (d *DecryptionContext) StartDecryption(p *format2.Preamble) (*format2.CipherObject, error)

type EncryptionContext

type EncryptionContext struct {
	PublicKey PublicKey
	PK_Algo   string
	Encoding  string
	Random    io.Reader
}

Encrypter for non-Wrapped Opaques.

func (*EncryptionContext) StartEncryption

func (e *EncryptionContext) StartEncryption() (*format2.Preamble, *format2.CipherObject, error)

type InvalidKeyError

type InvalidKeyError string

func (InvalidKeyError) Error

func (e InvalidKeyError) Error() string

type KeyRing

type KeyRing interface {
	// GetKey SHOULD return the corresponding private key for a ciphertext.
	GetKey(opaque []byte, pk_algo string) (PrivateKey, error)
}

func AsKeyRing

func AsKeyRing(priv PrivateKey) KeyRing

type KeyRing2

type KeyRing2 interface {
	// GetKey2 SHOULD return the corresponding private key for a ciphertext.
	//
	// This works like GetKey except, that opaque might be substituted by n_opaque
	GetKey2(opaque []byte, pk_algo string) (n_opaque []byte, pk PrivateKey, err error)
}

Key-Ring object for wrapped opaques.

type MalformedEncryptedKeyError

type MalformedEncryptedKeyError string

func (MalformedEncryptedKeyError) Error

type MalformedKeyError

type MalformedKeyError string

func (MalformedKeyError) Error

func (e MalformedKeyError) Error() string

type Pka_Driver

type Pka_Driver interface {
	GenerateKeyPair(rand io.Reader) (pub, priv []byte, err error)
	LoadPublic(pub []byte) (PublicKey, error)
	LoadPrivate(priv []byte) (PrivateKey, error)

	DecryptKey(opaque []byte, prik PrivateKey, cb *Cipher_Buffer) error
	EncryptKey(rand io.Reader, pubk PublicKey, cb *Cipher_Buffer) (opaque []byte, err error)
}

type PrivateKey

type PrivateKey interface{}

func LoadPrivateKey

func LoadPrivateKey(pk_algo string, priv []byte) (PrivateKey, error)

type PublicKey

type PublicKey interface{}

func LoadPublicKey

func LoadPublicKey(pk_algo string, pub []byte) (PublicKey, error)

type UnknownCipherError

type UnknownCipherError string

func (UnknownCipherError) Error

func (e UnknownCipherError) Error() string

type UnknownPkaError

type UnknownPkaError string

func (UnknownPkaError) Error

func (e UnknownPkaError) Error() string

Directories

Path Synopsis
Implements AES (128,192,256) in various modes of operations.
Implements AES (128,192,256) in various modes of operations.
Implements AEZ AEAD cipher.
Implements AEZ AEAD cipher.
This package implements support for bcns, a key exchange based on the Ring Learning With Errors Problem.
This package implements support for bcns, a key exchange based on the Ring Learning With Errors Problem.
Implements Block Modes.
Implements Block Modes.
European Brainpool ECC curves.
European Brainpool ECC curves.
Implements CAMELLIA encryption algorithm (128,192,256 bit) in various modes of operations.
Implements CAMELLIA encryption algorithm (128,192,256 bit) in various modes of operations.
Implements the ChaCha20-Poly1305 AEAD as specified in RFC 7539, and its extended nonce variant XChaCha20-Poly1305.
Implements the ChaCha20-Poly1305 AEAD as specified in RFC 7539, and its extended nonce variant XChaCha20-Poly1305.
This package implements the cleptographic ECC curves from FIPS 186-3.
This package implements the cleptographic ECC curves from FIPS 186-3.
Implements the HS1-SIV Authenticated Cipher.
Implements the HS1-SIV Authenticated Cipher.
Bitelliptic implements several Koblitz PK_Algo = ( "koblitz_s160" "koblitz_s192" "koblitz_s224" "koblitz_s256" )
Bitelliptic implements several Koblitz PK_Algo = ( "koblitz_s160" "koblitz_s192" "koblitz_s224" "koblitz_s256" )
Implements ciphers from Korea Internet Security Agency.
Implements ciphers from Korea Internet Security Agency.
Implements the MORUS-1280-256 Authenticated Cipher.
Implements the MORUS-1280-256 Authenticated Cipher.
This package implements support for newhope, a key exchange based on the Ring Learning With Errors Problem.
This package implements support for newhope, a key exchange based on the Ring Learning With Errors Problem.
This package implements support for curve25519 PK_Algo = ( "curve25519" )
This package implements support for curve25519 PK_Algo = ( "curve25519" )
Key Derivation functions for Public-Key-Algorithms.
Key Derivation functions for Public-Key-Algorithms.
Implements Twofish (128,192,256 keysize) in various modes of operations.
Implements Twofish (128,192,256 keysize) in various modes of operations.
This package implements support for x448 PK_Algo = ( "x448" )
This package implements support for x448 PK_Algo = ( "x448" )

Jump to

Keyboard shortcuts

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