Documentation
¶
Index ¶
- func ByteCountIEC(b int64) string
- func ByteCountSI(b int64) string
- func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
- func BytesToPublicKey(pub []byte) *rsa.PublicKey
- func CreateHash(key string) string
- func CreateHashByte(key []byte) string
- func Decrypt(data []byte, passphrase string) []byte
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
- func Encrypt(data []byte, passphrase string) []byte
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) []byte
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
- func GenerateUUID() string
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) []byte
- type Certificate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
BytesToPrivateKey bytes to private key
func BytesToPublicKey ¶
BytesToPublicKey bytes to public key
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
DecryptWithPrivateKey decrypts data with private key
func EncryptWithPublicKey ¶
EncryptWithPublicKey -
func GenerateKeyPair ¶
func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
GenerateKeyPair generates a new key pair
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
PrivateKeyToBytes private key to bytes
Types ¶
type Certificate ¶
Certificate -
Click to show internal directories.
Click to hide internal directories.