Documentation ¶
Overview ¶
Package cryptoutils provides a set of methods / functions to simplify typical flows concerning cryptographic operations
Index ¶
- Constants
- type Bits
- type RSA
- func (e *RSA) Decrypt(cipherMsg []byte, h hash.Hash) ([]byte, error)
- func (e *RSA) Encrypt(clearMsg []byte, h hash.Hash) ([]byte, error)
- func (e *RSA) PrivKey() *rsa.PrivateKey
- func (e *RSA) PrivKeyPEM() *pem.Block
- func (e *RSA) PrivKeyString() string
- func (e *RSA) PubKey() *rsa.PublicKey
- func (e *RSA) PubKeyPEM() *pem.Block
Constants ¶
View Source
const ( Bits2048 = 2048 Bits4096 = 4096 Bits8192 = 8192 )
Provide various common key sizes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RSA ¶
type RSA struct {
// contains filtered or unexported fields
}
RSA denotes an RSA public / private key pair
func NewFromPEM ¶
NewFromPEM reads a private key from a PEM block
func NewFromString ¶
NewFromString reads a private key / RSA object from a base64 encoded string
func (*RSA) Decrypt ¶
Decrypt decrypts a message using RSA-OAEP, using the hash h (falling back to sha256 if nil)
func (*RSA) Encrypt ¶
Encrypt encrypts a message using RSA-OAEP, using the hash h (falling back to sha256 if nil)
func (*RSA) PrivKeyPEM ¶
PrivKeyPEM returns the private key as PEM block
func (*RSA) PrivKeyString ¶
PrivKeyString returns the private key as base64 encoded PEM block
Click to show internal directories.
Click to hide internal directories.