rsa

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2022 License: MIT Imports: 8 Imported by: 0

README

rsa

import "github.com/euforic/pkg-go/rsa"

Index

func PublicKeyFromBytes

func PublicKeyFromBytes(b []byte) (*rsa.PublicKey, error)

PublicKeyFromBytes takes in the public key bytes and decodes the public key only

type Rsa

Rsa...

type Rsa struct {
    Private *rsa.PrivateKey
    Public  *rsa.PublicKey
}
func New
func New() *Rsa

New creates a new instance of *Rsa

func (*Rsa) Generate
func (r *Rsa) Generate() error

Generate gerates the public and private keys and sets them

func (*Rsa) ReadPrivateKey
func (r *Rsa) ReadPrivateKey(reader io.Reader) error

ReadPrivateKey takes in the private key bytes and decodes and sets the private and public key

func (*Rsa) ReadPublicKey
func (r *Rsa) ReadPublicKey(reader io.Reader) error

ReadPrivateKey takes in the public key bytes and decodes and sets the public key only

func (Rsa) WritePrivateKey
func (r Rsa) WritePrivateKey(w io.Writer) error

WritePrivateKey encodes the rsa.Private key to the io.Writer

func (Rsa) WritePublicKey
func (r Rsa) WritePublicKey(w io.Writer) error

WritePublicKey encodes the rsa.Private key to the io.Writer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicKeyFromBytes

func PublicKeyFromBytes(b []byte) (*rsa.PublicKey, error)

PublicKeyFromBytes takes in the public key bytes and decodes the public key only

Types

type Rsa

type Rsa struct {
	Private *rsa.PrivateKey
	Public  *rsa.PublicKey
}

Rsa...

func New

func New() *Rsa

New creates a new instance of *Rsa

func (*Rsa) Generate

func (r *Rsa) Generate() error

Generate gerates the public and private keys and sets them

func (*Rsa) ReadPrivateKey

func (r *Rsa) ReadPrivateKey(reader io.Reader) error

ReadPrivateKey takes in the private key bytes and decodes and sets the private and public key

func (*Rsa) ReadPublicKey

func (r *Rsa) ReadPublicKey(reader io.Reader) error

ReadPrivateKey takes in the public key bytes and decodes and sets the public key only

func (Rsa) WritePrivateKey

func (r Rsa) WritePrivateKey(w io.Writer) error

WritePrivateKey encodes the rsa.Private key to the io.Writer

func (Rsa) WritePublicKey

func (r Rsa) WritePublicKey(w io.Writer) error

WritePublicKey encodes the rsa.Private key to the io.Writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL