rsa

package
v0.0.0-...-0872f49 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	E              = 65537
	KEY_SIZE       = 128
	PRIVKEY        = "RSA PRIVATE KEY"
	PUBKEY         = "RSA PUBLIC KEY"
	SALT_SIZE      = 32
	SIGNATURE_SIZE = KEY_SIZE
)

Variables

This section is empty.

Functions

func GenerateKeypair

func GenerateKeypair() (*PrivateKey, *PublicKey)

func NewPSSOptions

func NewPSSOptions() *rsa.PSSOptions

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func NewPrivateKey

func NewPrivateKey(inner rsa.PrivateKey) *PrivateKey

func (*PrivateKey) Bytes

func (priv *PrivateKey) Bytes() []byte

func (*PrivateKey) IsPrivateKey

func (_ *PrivateKey) IsPrivateKey()

func (*PrivateKey) MarshalPEM

func (priv *PrivateKey) MarshalPEM() []byte

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(message []byte) crypto.Signature

func (*PrivateKey) String

func (priv *PrivateKey) String() string

func (*PrivateKey) UnmarshalPEM

func (priv *PrivateKey) UnmarshalPEM(pem []byte) error

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(inner rsa.PublicKey) *PublicKey

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() []byte

Returns value of public modulus as a big-endian byte slice

func (*PublicKey) Equals

func (pub *PublicKey) Equals(other crypto.PublicKey) bool

func (*PublicKey) FromBytes

func (pub *PublicKey) FromBytes(p []byte) error

func (*PublicKey) FromString

func (pub *PublicKey) FromString(str string) error

func (*PublicKey) IsPublicKey

func (_ *PublicKey) IsPublicKey()

func (*PublicKey) MarshalJSON

func (pub *PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) MarshalPEM

func (pub *PublicKey) MarshalPEM() []byte

func (*PublicKey) String

func (pub *PublicKey) String() string

func (*PublicKey) UnmarshalJSON

func (pub *PublicKey) UnmarshalJSON(inner []byte) error

func (*PublicKey) UnmarshalPEM

func (pub *PublicKey) UnmarshalPEM(pem []byte) error

func (*PublicKey) Verify

func (pub *PublicKey) Verify(message []byte, sig crypto.Signature) bool

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func NewSignature

func NewSignature(inner []byte) *Signature

func (*Signature) Bytes

func (sig *Signature) Bytes() []byte

func (*Signature) Equals

func (sig *Signature) Equals(other crypto.Signature) bool

func (*Signature) FromBytes

func (sig *Signature) FromBytes(p []byte) error

func (*Signature) FromString

func (sig *Signature) FromString(str string) error

func (*Signature) IsSignature

func (_ *Signature) IsSignature()

func (*Signature) MarshalJSON

func (sig *Signature) MarshalJSON() ([]byte, error)

func (*Signature) String

func (sig *Signature) String() string

func (*Signature) UnmarshalJSON

func (sig *Signature) UnmarshalJSON(inner []byte) error

Jump to

Keyboard shortcuts

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