Documentation ¶
Index ¶
- Constants
- Variables
- func DecryptWithAES(data []byte, key []byte) ([]byte, error)
- func DecryptWithKey(key *pb.Key, ciphertext []byte) ([]byte, error)
- func DeriveAesKey(password []byte, salt []byte) []byte
- func EncryptWithAES(data []byte, key []byte) ([]byte, error)
- func EncryptWithKey(key *pb.Key, plaintext []byte) ([]byte, error)
- func GenerateAESKey(random io.Reader) ([]byte, error)
- func GenerateNonce() ([]byte, error)
- func GetCryptoConfigKey(key *pb.Key) (encconfig.CryptoConfig, error)
- func NewKey(keyType string) (*pb.Key, error)
Constants ¶
View Source
const ( KeyTypeEcdsaP256 = "ECDSAP256" KeyTypeRsa4096 = "RSA4096" KeyTypeAESGCM256 = "AESGCM256" )
View Source
const AES_KEY_SIZE = 32
View Source
const ITER_COUNT = 10
View Source
const NONCE_SIZE = 12
Variables ¶
View Source
var KeyTypeEncrypt = KeyTypeAESGCM256
View Source
var KeyTypeOcicrypt = KeyTypeEcdsaP256
Functions ¶
func DeriveAesKey ¶
could drive a nonce or a symmetric key, both are []byte
func GenerateAESKey ¶
Generate a AES_KEY_SIZE-byte random key
func GetCryptoConfigKey ¶
func GetCryptoConfigKey(key *pb.Key) (encconfig.CryptoConfig, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.