Documentation ¶
Index ¶
- func EnsureHaliteDirsExist()
- type HaliteKey
- type HalitePrivateKey
- type HalitePublicKey
- func (key HalitePublicKey) Armored(brand string) string
- func (key HalitePublicKey) Bytes() []byte
- func (key HalitePublicKey) Public() HalitePublicKey
- func (key HalitePublicKey) Save(ext string) error
- func (key HalitePublicKey) SaveToIndex(hash string) error
- func (key HalitePublicKey) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureHaliteDirsExist ¶
func EnsureHaliteDirsExist()
Types ¶
type HalitePrivateKey ¶
type HalitePrivateKey struct { // The traditionally-capitalized algorithm name, such as Ed25519 or RSA. // EdX25519 is the name of an Ed25519 key stored with a companion X25519 key. Algorithm string // The white-label brand stored with the key. Brand string // The annotations attached to the key. // These are stored as an embedded document in the msgpack. Annotations map[string]any // The private annotations attached to the key. // These are simply not shared, and I'll probably encrypt them // using the encryption key in the future. PrivateAnnotations map[string]any // The actual data of the private Ed25519 key. // It's the private key (32 bytes), followed by the public key (32 bytes). PrivateSigningKey []byte // The actual data of the private X25519 key. // It's the private key (32 bytes), followed by the public key (32 bytes). PrivateEncryptionKey []byte // contains filtered or unexported fields }
A base Halite key, as it would be stored.
func LoadAllHalitePrivateKeys ¶
func LoadAllHalitePrivateKeys(query string) ([]HalitePrivateKey, error)
Load a Halite private key by its name. Pass an empty string to get all keys.
func LoadHalitePrivateKey ¶
func LoadHalitePrivateKey(query string) (HalitePrivateKey, error)
Load a Halite private key by its name.
func UnmarshalHalitePrivateKey ¶
func UnmarshalHalitePrivateKey(bytes []byte) (HalitePrivateKey, error)
func (HalitePrivateKey) Bytes ¶
func (key HalitePrivateKey) Bytes() []byte
func (HalitePrivateKey) Public ¶
func (key HalitePrivateKey) Public() HalitePublicKey
func (HalitePrivateKey) Save ¶
func (key HalitePrivateKey) Save(ext string) error
func (HalitePrivateKey) SaveToIndex ¶
func (key HalitePrivateKey) SaveToIndex(hash string) error
func (HalitePrivateKey) String ¶
func (key HalitePrivateKey) String() string
HaliteKey as a string, for development.
type HalitePublicKey ¶
type HalitePublicKey struct { // The traditionally-capitalized algorithm name, such as Ed25519 or RSA. // EdX25519 is the name of an Ed25519 key stored with a companion X25519 key. Algorithm string // The white-label brand stored with the key. Brand string // The annotations attached to the key. // These are stored as an embedded document in the msgpack. Annotations map[string]any // The actual data of the Ed25519 private key. // Use this to verify that the holder of the corresponding public key // really was the one to sign the data you're looking at. // 32 bytes. PublicSigningKey []byte // The actual data of the X25519 public key. // Use this to encrypt data so that only the holder of the corresponding // private key can read it. // 32 bytes. PublicEncryptionKey []byte // contains filtered or unexported fields }
func LoadAllHalitePublicKeys ¶
func LoadAllHalitePublicKeys(query string) ([]HalitePublicKey, error)
Load a Halite public key by its filename. Pass an empty string to get all keys.
func LoadHalitePublicKey ¶
func LoadHalitePublicKey(query string) (HalitePublicKey, error)
Load a Halite public key by its filename.
func UnmarshalHalitePublicKey ¶
func UnmarshalHalitePublicKey(bytes []byte) (HalitePublicKey, error)
func (HalitePublicKey) Armored ¶
func (key HalitePublicKey) Armored(brand string) string
func (HalitePublicKey) Bytes ¶
func (key HalitePublicKey) Bytes() []byte
func (HalitePublicKey) Public ¶
func (key HalitePublicKey) Public() HalitePublicKey
func (HalitePublicKey) Save ¶
func (key HalitePublicKey) Save(ext string) error
func (HalitePublicKey) SaveToIndex ¶
func (key HalitePublicKey) SaveToIndex(hash string) error
func (HalitePublicKey) String ¶
func (key HalitePublicKey) String() string
Click to show internal directories.
Click to hide internal directories.