Categorygithub.com/metadiv-io/rsa
modulepackage
1.0.0
Repository: https://github.com/metadiv-io/rsa.git
Documentation: pkg.go.dev

# README

rsa v1

A Go package that provides a simple and secure interface for RSA key generation, management, and PEM encoding/decoding.

Installation

go get -u github.com/metadiv-io/rsa

Documentation

rsa v1

# Functions

New4096RSAKey creates a new RSA private key with 4096 bits.
NewPrivateKeyFromPem creates a new private key from a PEM encoded string.
NewPublicKeyFromPem creates a new public key from a PEM encoded string.
NewRSAKey creates a new RSA private key with the given number of bits.

# Variables

ErrBitSizeTooSmall is returned when the bit size is less than 1024.
ErrInvalidBitSize is returned when the bit size is invalid.
ErrInvalidPEM is returned when the PEM string is invalid.
ErrInvalidPrivateKey is returned when the key cannot be parsed as an RSA private key.
ErrInvalidPrivateKeyPEM is returned when the PEM string is invalid.
ErrNotRSAPublicKey is returned when the key is not an RSA public key.

# Structs

PrivateKey is a private key for RSA encryption.
PublicKey is a public key for RSA encryption.