Documentation ¶
Index ¶
- Constants
- func InitCipher(secret SharedSecret) (cipher.Block, error)
- type Encrypter
- type EncrypterMarshal
- type EncryptionPrivKeyType
- type EncryptionPubKeyType
- type ISigner
- type IncompatibleKeyPair
- type MarshalledKey
- type SecurityViolation
- type SharedSecret
- type Signature
- type Signer
- func (b *Signer) Encode() SignerMarshal
- func (b *Signer) Generate() *Signer
- func (b *Signer) MarshalPrivate() string
- func (b *Signer) MarshalPublic() string
- func (b *Signer) Sign(data []byte) (Signature, error)
- func (b *Signer) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error)
- func (b *Signer) UnmarshalPublic(marshalled string) (SigningPubKeyType, error)
- func (b *Signer) Verify(data []byte, signature Signature) bool
- type SignerMarshal
- type SigningPrivKeyType
- type SigningPubKeyType
- type SymmetricEncryption
Constants ¶
View Source
const ( SignatureSize = ed25519.SignatureSize PublicKeySize = ed25519.PublicKeySize PrivateKeySize = ed25519.SeedSize )
Variables ¶
This section is empty.
Functions ¶
func InitCipher ¶
func InitCipher(secret SharedSecret) (cipher.Block, error)
Types ¶
type Encrypter ¶
type Encrypter struct { // Do not use this outside of Marshalling! Private ecdh.PrivateKey Public ecdh.PublicKey }
type EncrypterMarshal ¶
type EncrypterMarshal MarshalledKey
type EncryptionPrivKeyType ¶
type EncryptionPrivKeyType = *ecdh.PrivateKey
type EncryptionPubKeyType ¶
type IncompatibleKeyPair ¶ added in v0.10.1
type IncompatibleKeyPair error
type MarshalledKey ¶
type SecurityViolation ¶ added in v0.10.1
type SecurityViolation error
type SharedSecret ¶
type SharedSecret []byte
func GetSharedSecret ¶
func GetSharedSecret(me *Encrypter, other *Encrypter) (SharedSecret, error)
type Signer ¶
type Signer struct { // Do not use this for Marshalling! Private SigningPrivKeyType Public SigningPubKeyType }
func (*Signer) Encode ¶
func (b *Signer) Encode() SignerMarshal
Returns a struct for optimized marshalling as base64 strings
func (*Signer) MarshalPrivate ¶
func (*Signer) MarshalPublic ¶
func (*Signer) UnmarshalPrivate ¶
func (b *Signer) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error)
func (*Signer) UnmarshalPublic ¶
func (b *Signer) UnmarshalPublic(marshalled string) (SigningPubKeyType, error)
type SignerMarshal ¶
type SignerMarshal MarshalledKey
func (*SignerMarshal) Decode ¶
func (b *SignerMarshal) Decode() (*Signer, error)
Takes the struct from Signer.Marshal
type SigningPrivKeyType ¶
type SigningPrivKeyType = ed25519.PrivateKey
type SigningPubKeyType ¶
type SymmetricEncryption ¶
type SymmetricEncryption interface { Encrypt(secret SharedSecret, date []byte) ([]byte, error) Decrypt(secret SharedSecret, data []byte) ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.