Documentation
¶
Index ¶
- func DecryptAESGCM(ciphertext, key, nonce []byte) ([]byte, error)
- func DecryptAESGCMWithNonceEmbed(data, key []byte) ([]byte, error)
- func EncryptAESGCM(plain, key []byte) (ciphertext, nonce []byte, err error)
- func EncryptAESGCMWithNonceEmbed(plaintext, key []byte) ([]byte, error)
- func MarshalP256PublicKey(publicKey *ecdsa.PublicKey) ([]byte, error)
- func ParseEd25519PublicKeyFromHex(hexKey string) ([]byte, error)
- func ParseP256PrivateKey(keyData []byte) (*ecdsa.PrivateKey, error)
- func ParseP256PublicKeyFromBase64(base64String string) (*ecdsa.PublicKey, error)
- func ParseP256PublicKeyFromBytes(keyBytes []byte) (*ecdsa.PublicKey, error)
- func ParseP256PublicKeyFromHex(hexString string) (*ecdsa.PublicKey, error)
- func SignWithP256(privateKey *ecdsa.PrivateKey, data []byte) ([]byte, error)
- func ValidateEd25519PublicKey(keyBytes []byte) error
- func ValidateP256PublicKey(publicKey *ecdsa.PublicKey) error
- func VerifyP256Signature(publicKey *ecdsa.PublicKey, data []byte, signature []byte) error
- type KeyData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAESGCM ¶
func DecryptAESGCMWithNonceEmbed ¶ added in v0.3.2
DecryptAESGCMWithNonceEmbed decrypts ciphertext where the nonce is embedded at the start of the slice.
func EncryptAESGCM ¶
func EncryptAESGCMWithNonceEmbed ¶ added in v0.3.2
EncryptAESGCMWithNonceEmbed encrypts plaintext and embeds the nonce at the start of the returned slice.
func MarshalP256PublicKey ¶ added in v0.3.2
MarshalP256PublicKey marshals a P256 public key to DER format
func ParseEd25519PublicKeyFromHex ¶ added in v0.3.2
ParseEd25519PublicKeyFromHex parses a hex-encoded Ed25519 public key and validates it. Returns the public key as []byte and an error if invalid.
func ParseP256PrivateKey ¶ added in v0.3.2
func ParseP256PrivateKey(keyData []byte) (*ecdsa.PrivateKey, error)
ParseP256PrivateKey parses a P256 private key from either DER or hex format
func ParseP256PublicKeyFromBase64 ¶ added in v0.3.2
ParseP256PublicKeyFromBase64 parses a P-256 public key from base64 string
func ParseP256PublicKeyFromBytes ¶ added in v0.3.2
func ParseP256PublicKeyFromHex ¶ added in v0.3.2
ParseP256PublicKeyFromHex parses a P-256 public key from hex string
func SignWithP256 ¶ added in v0.3.2
func SignWithP256(privateKey *ecdsa.PrivateKey, data []byte) ([]byte, error)
SignWithP256 signs data using a P256 private key
func ValidateEd25519PublicKey ¶ added in v0.3.2
ValidateEd25519PublicKey validates an existing byte slice as a valid Ed25519 public key
func ValidateP256PublicKey ¶ added in v0.3.2
ValidateP256PublicKey validates that a public key is P-256
Types ¶
type KeyData ¶ added in v0.3.2
func GenerateEd25519Keys ¶ added in v0.3.2
generateEd25519Keys generates Ed25519 keypair