Documentation
¶
Index ¶
- func GenerateKeys(bits int) (*rsa.PrivateKey, error)
- func LoadPrivateKey(path string) (*rsa.PrivateKey, error)
- func LoadPublicKey(path string) (*rsa.PublicKey, error)
- func PrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)
- func PublicKeyFromBytes(data []byte) (*rsa.PublicKey, error)
- func Sign(key *rsa.PrivateKey, msg []byte) ([]byte, error)
- func StorePrivateKey(privateKey *rsa.PrivateKey, path string) error
- func StorePublicKey(publicKey *rsa.PublicKey, path string) error
- func Verify(key *rsa.PublicKey, msg []byte, sig []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
func GenerateKeys(bits int) (*rsa.PrivateKey, error)
GenerateKeys generates RSA public and private keys with a given bit strength.
func LoadPrivateKey ¶
func LoadPrivateKey(path string) (*rsa.PrivateKey, error)
LoadPrivateKey loads a RSA private key as PEM from disk.
func LoadPublicKey ¶
LoadPublicKey loads a RSA public key as PEM from disk.
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)
PrivateKeyFromBytes parses a RSA private key as PEM from bytes.
func PublicKeyFromBytes ¶
PublicKeyFromBytes parses a RSA public key as PEM from bytes.
func Sign ¶
func Sign(key *rsa.PrivateKey, msg []byte) ([]byte, error)
Sign RSA PKCS#1 v1.5 signs a message with a given private key.
func StorePrivateKey ¶
func StorePrivateKey(privateKey *rsa.PrivateKey, path string) error
StorePrivateKey stores a RSA private key as PEM on disk.
func StorePublicKey ¶
StorePublicKey stores a RSA public key as PEM on disk.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.