Documentation ¶
Index ¶
- func ConvertBase64StrToBytes(key string) ([]byte, error)
- func ConvertPrivateKeyToInterface(privateKey *rsa.PrivateKey) interface{}
- func ConvertPublicKeyToInterface(publicKey *rsa.PublicKey) interface{}
- func ConvertToBase64Str(key []byte) string
- func CreateRSAKeys(keySize int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func CreateRandomKeyBytes(keySize int) ([]byte, error)
- func LoadPrivateKeyFromPemData(reader io.Reader) (*rsa.PrivateKey, error)
- func LoadPublicKeyFromPemData(reader io.Reader) *rsa.PublicKey
- func PemEncodeKeyToOutput(key interface{}, out io.Writer) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBase64StrToBytes ¶
ConvertBase64StrToBytes decodes a base64 encoded string and converts to bytes.
func ConvertPrivateKeyToInterface ¶
func ConvertPrivateKeyToInterface(privateKey *rsa.PrivateKey) interface{}
ConvertPrivateKeyToInterface creates an interface abstraction for an RSA private key.
func ConvertPublicKeyToInterface ¶
ConvertPublicKeyToInterface creates an interface abstraction for an RSA public key.
func ConvertToBase64Str ¶
ConvertToBase64Str converts bytes to a base64 encoded string.
func CreateRSAKeys ¶
CreateRSAKeys creates a private/public RSA key pair.
func CreateRandomKeyBytes ¶
CreateRandomKeyBytes creates a random slice of bytes with support for 16, 24 and 32 byte lengths.
func LoadPrivateKeyFromPemData ¶
func LoadPrivateKeyFromPemData(reader io.Reader) (*rsa.PrivateKey, error)
LoadPrivateKeyFromPemData extracts the pem encoded private key and converts it to a private key structure.
func LoadPublicKeyFromPemData ¶
LoadPublicKeyFromPemData extracts the pem encoded public key and converts it to a public key structure.
func PemEncodeKeyToOutput ¶
PemEncodeKeyToOutput creates a pem encoding for the provided key and writes the encoded block to the provided io.Writer.
A PEM type convention name is returned.
Types ¶
This section is empty.