Documentation
¶
Index ¶
- Constants
- func Decode(encoded string) ([]byte, error)
- func DecryptSecretValue(ciphertext []byte, nonce []byte, projectKey []byte) (string, error)
- func Encode(data []byte) string
- func EncodeEd25519PublicKey(publicKey ed25519.PublicKey) (string, error)
- func EncodeEd25519Signature(signature []byte) (string, error)
- func EncodeX25519PublicKey(publicKey []byte) (string, error)
- func EncryptSecretValue(value string, projectKey []byte) ([]byte, []byte, error)
- func GenerateEd25519Keypair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GenerateX25519Keypair() ([]byte, []byte, error)
- func UnwrapProjectKey(wrappedKey string, devicePrivateKey []byte) ([]byte, error)
- func WrapProjectKey(projectKey []byte, devicePublicKey []byte) (string, error)
Constants ¶
View Source
const ( ProjectKeySize = 32 // 256 bits for XSalsa20Poly1305 (NaCl secretbox) X25519PrivateKeySize = 32 // X25519 private key size SecretboxNonceSize = 24 // XSalsa20Poly1305 nonce size (NaCl secretbox) UserTokenSize = 32 // User authentication token size )
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode provides general base64 decoding for binary data Tries multiple base64 formats for compatibility
func DecryptSecretValue ¶
DecryptSecretValue decrypts a secret value using ChaCha20Poly1305
func EncodeEd25519PublicKey ¶
EncodeEd25519PublicKey encodes an Ed25519 public key for API transmission
func EncodeEd25519Signature ¶
EncodeEd25519Signature encodes an Ed25519 signature for authentication headers
func EncodeX25519PublicKey ¶
EncodeX25519PublicKey encodes an X25519 public key for API transmission
func EncryptSecretValue ¶
EncryptSecretValue encrypts a secret value using ChaCha20Poly1305
func GenerateEd25519Keypair ¶
func GenerateEd25519Keypair() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateEd25519Keypair generates a new Ed25519 keypair
func GenerateX25519Keypair ¶
GenerateX25519Keypair generates a new X25519 keypair
func UnwrapProjectKey ¶ added in v0.4.0
UnwrapProjectKey unwraps a project key with a device private key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.