Documentation ¶
Index ¶
- Constants
- func InitCipher(secret SharedSecret) (cipher.Block, error)
- type Encrypter
- type EncrypterMarshal
- type EncryptionPrivKeyType
- type EncryptionPubKeyType
- 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 }
type EncrypterMarshal ¶ added in v0.6.8
type EncrypterMarshal MarshalledKey
type EncryptionPrivKeyType ¶ added in v0.7.1
type EncryptionPrivKeyType = *ecdh.PrivateKey
type EncryptionPubKeyType ¶ added in v0.7.1
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.