Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAESMode = errors.New("invalid AES encryption mode") ErrCiphertextTooShortToDecrypt = errors.New("ciphertext is too short to decrypt") ErrCiphertextIsEmpty = errors.New("cipher text is empty") ErrCiphertextIsNotBlockAligned = errors.New("ciphertext is not block-aligned") )
errors
Functions ¶
func GenerateRSAKey ¶
func GenerateRSAKey(size int) (*rsa.PrivateKey, error)
Generates a new RSA key by the given size
Types ¶
type AES ¶
type AES struct {
// contains filtered or unexported fields
}
AES implementation for symmetric cryptography
type Asymmetric ¶
The asymmetric cryptography interface This type of cryptography uses to decrypt the encrypted message from the client in the handshaking process
type RSACrypto ¶
type RSACrypto struct {
// contains filtered or unexported fields
}
An implementation of RSA for asymmetric cryptography
func NewRSAFromBytes ¶
Returns a new instance of RSA implementation by the given private key bytes
func NewRSAFromPK ¶
func NewRSAFromPK(key *rsa.PrivateKey) *RSACrypto
Returns a new instance of RSA implementation by the given private key
type RSAEncryptor ¶
type RSAEncryptor struct {
// contains filtered or unexported fields
}
func NewRSAEncryptorFromPK ¶
func NewRSAEncryptorFromPK(key *rsa.PublicKey) *RSAEncryptor
Click to show internal directories.
Click to hide internal directories.