Documentation ¶
Index ¶
- type Certificate
- type PrivateKey
- func (pk PrivateKey) Base64() string
- func (pk PrivateKey) Bytes() []byte
- func (pk PrivateKey) Certificate() (res Certificate)
- func (pk PrivateKey) Decrypt(peerKey [32]byte, message []byte) (result []byte, ok bool)
- func (pk PrivateKey) Encrypt(peerKey [32]byte, message []byte) (result []byte, err error)
- func (pk PrivateKey) MarshalJSON() ([]byte, error)
- func (pk PrivateKey) Public() (res PublicKey)
- func (pk PrivateKey) Sign(message []byte) (signature []byte)
- func (pk PrivateKey) String() string
- func (pk *PrivateKey) UnmarshalJSON(b []byte) error
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate [32]byte
func CertificateFromString ¶
func CertificateFromString(value string) (res Certificate)
func (Certificate) MarshalJSON ¶
func (crt Certificate) MarshalJSON() ([]byte, error)
func (Certificate) String ¶
func (crt Certificate) String() string
func (*Certificate) UnmarshalJSON ¶
func (crt *Certificate) UnmarshalJSON(b []byte) error
type PrivateKey ¶
type PrivateKey [64]byte
func GeneratePrivateKey ¶
func GeneratePrivateKey() (res PrivateKey)
func PrivateKeyFromBase64 ¶
func PrivateKeyFromBase64(value string) (res PrivateKey, err error)
func (PrivateKey) Base64 ¶
func (pk PrivateKey) Base64() string
func (PrivateKey) Bytes ¶
func (pk PrivateKey) Bytes() []byte
func (PrivateKey) Certificate ¶
func (pk PrivateKey) Certificate() (res Certificate)
func (PrivateKey) Decrypt ¶
func (pk PrivateKey) Decrypt(peerKey [32]byte, message []byte) (result []byte, ok bool)
func (PrivateKey) Encrypt ¶
func (pk PrivateKey) Encrypt(peerKey [32]byte, message []byte) (result []byte, err error)
func (PrivateKey) MarshalJSON ¶
func (pk PrivateKey) MarshalJSON() ([]byte, error)
func (PrivateKey) Public ¶
func (pk PrivateKey) Public() (res PublicKey)
func (PrivateKey) Sign ¶
func (pk PrivateKey) Sign(message []byte) (signature []byte)
func (PrivateKey) String ¶
func (pk PrivateKey) String() string
func (*PrivateKey) UnmarshalJSON ¶
func (pk *PrivateKey) UnmarshalJSON(b []byte) error
type PublicKey ¶
type PublicKey [32]byte
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.