Documentation
¶
Index ¶
- Constants
- func CreateBase64EncodedPublicKey(key *rsa.PrivateKey) (encodedKey []byte, e error)
- func DecryptAES(block cipher.Block, iv []byte, encrypted []byte) (unencrypted []byte)
- func DecryptOAEP(privateKey crypto.PrivateKey, encrypted []byte) (decrypted []byte, e error)
- func EncryptAES(block cipher.Block, iv []byte, unencrypted []byte) (encrypted []byte)
- func EncryptOAEP(publicKey crypto.PublicKey, unencrypted []byte) (encrypted []byte, e error)
- func GetPrivateKey(privateKeyPath string) (key *rsa.PrivateKey, e error)
- func InitializeUcpDir(ucpdir string) (e error)
- func NewCipherBlock() (block cipher.Block, key []byte, e error)
- func UcpKeyGenerate(privateKeyPath, publicKeyPath string) (e error)
Constants ¶
View Source
const ( IVBlockSize = 16 AESKeySize = 32 KeySize = 4096 )
Defines key sizes and initialization vector size for AES encryption
Variables ¶
This section is empty.
Functions ¶
func CreateBase64EncodedPublicKey ¶
func CreateBase64EncodedPublicKey(key *rsa.PrivateKey) (encodedKey []byte, e error)
CreateBase64EncodedPublicKey returns a textual representation of the pubilc key suitable for authorized_keys files
func DecryptAES ¶
DecryptAES decrypts a a string with symmetric encryption
func DecryptOAEP ¶
func DecryptOAEP(privateKey crypto.PrivateKey, encrypted []byte) (decrypted []byte, e error)
DecryptOAEP decrypts a buffer
func EncryptAES ¶
EncryptAES Encrypt a string with symmetric encryption
func EncryptOAEP ¶
EncryptOAEP encrypts a buffer
func GetPrivateKey ¶
func GetPrivateKey(privateKeyPath string) (key *rsa.PrivateKey, e error)
GetPrivateKey returns a private key
func InitializeUcpDir ¶
Sets up directory used by UCP
func NewCipherBlock ¶
NewCipherBlock returns a key that can be used for AES encryption
func UcpKeyGenerate ¶
generates public/private keys and write each to file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.