Documentation ¶
Index ¶
- Constants
- func InitCipher(secret SharedSecret) (cipher.Block, error)
- type Encrypter
- func (b *Encrypter) Decrypt(other *Encrypter, ciphertext []byte) ([]byte, error)
- func (b *Encrypter) Encode() SignerMarshal
- func (b *Encrypter) Encrypt(other *Encrypter, plain []byte) ([]byte, error)
- func (b *Encrypter) Generate()
- func (b *Encrypter) GetSharedSecret(other *Encrypter) ([]byte, error)
- func (b *Encrypter) MarshalPrivate() string
- func (b *Encrypter) MarshalPublic() string
- func (b *Encrypter) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error)
- func (b *Encrypter) UnmarshalPublic(marshalled string) (SigningPubKeyType, error)
- type EncrypterMarshal
- type ISigner
- type MarshalledKey
- 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 ¶ added in v0.6.8
func InitCipher(secret SharedSecret) (cipher.Block, error)
Types ¶
type Encrypter ¶ added in v0.6.8
type Encrypter struct { // Do not use this outside of Marshalling! Private ecdh.PrivateKey Public ecdh.PublicKey }
func (*Encrypter) Encode ¶ added in v0.6.8
func (b *Encrypter) Encode() SignerMarshal
Returns a struct for optimized marshalling as base64 strings
func (*Encrypter) GetSharedSecret ¶ added in v0.6.8
func (*Encrypter) MarshalPrivate ¶ added in v0.6.8
func (*Encrypter) MarshalPublic ¶ added in v0.6.8
func (*Encrypter) UnmarshalPrivate ¶ added in v0.6.8
func (b *Encrypter) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error)
func (*Encrypter) UnmarshalPublic ¶ added in v0.6.8
func (b *Encrypter) UnmarshalPublic(marshalled string) (SigningPubKeyType, error)
type EncrypterMarshal ¶ added in v0.6.8
type EncrypterMarshal MarshalledKey
func (*EncrypterMarshal) Decode ¶ added in v0.6.8
func (b *EncrypterMarshal) Decode() (*Signer, error)
Takes the struct from Signer.Marshal
type MarshalledKey ¶ added in v0.6.8
type SharedSecret ¶ added in v0.6.6
type SharedSecret []byte
func GetSharedSecret ¶ added in v0.6.8
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 ¶ added in v0.6.8
func (b *Signer) Encode() SignerMarshal
Returns a struct for optimized marshalling as base64 strings
func (*Signer) MarshalPrivate ¶ added in v0.6.8
func (*Signer) MarshalPublic ¶ added in v0.6.8
func (*Signer) UnmarshalPrivate ¶ added in v0.6.8
func (b *Signer) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error)
func (*Signer) UnmarshalPublic ¶ added in v0.6.8
func (b *Signer) UnmarshalPublic(marshalled string) (SigningPubKeyType, error)
type SignerMarshal ¶ added in v0.6.8
type SignerMarshal MarshalledKey
func (*SignerMarshal) Decode ¶ added in v0.6.8
func (b *SignerMarshal) Decode() (*Signer, error)
Takes the struct from Signer.Marshal
type SigningPrivKeyType ¶ added in v0.6.8
type SigningPrivKeyType = ed25519.PrivateKey
type SigningPubKeyType ¶ added in v0.6.8
type SymmetricEncryption ¶ added in v0.6.8
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.