keys

package
v0.0.0-...-8654c45 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_BLOCK_CYPHER      = "AES"
	DEFAULT_BLOCK_CYPHER_MODE = "CBC"
	DEFAULT_HASH_FUNCTION     = "SHA256"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptMethods

type AcceptMethods struct {
	BlocCypher      string
	BlockCypherMode string
	HashFunction    string
}

type PrivateKey

type PrivateKey struct {
	Version string
	Type    string // rsa, el gamal,...
	Key     *RSAPrivateKey
	Accept  *AcceptMethods
}

func GetDefaultRSAPrivateKey

func GetDefaultRSAPrivateKey(privateKey *rsa.PrivateKey) (*PrivateKey, error)

type PublicKey

type PublicKey struct {
	Type    string // rsa, el gamal,...
	Version string
	Key     *RSAPublicKey
	Accept  *AcceptMethods
}

func GetDefaultRSAPublicKey

func GetDefaultRSAPublicKey(publicKey *rsa.PublicKey) *PublicKey

type RSAPrivateKey

type RSAPrivateKey struct {
	N *big.Int `json:"n,omitempty"`
	P *big.Int `json:"p,omitempty"`
	Q *big.Int `json:"q,omitempty"`
	D *big.Int `json:"d,omitempty"`
	E int      `json:"e,omitempty"`
}

func NewRSAPrivateKey

func NewRSAPrivateKey(key *rsa.PrivateKey) *RSAPrivateKey

func (*RSAPrivateKey) MarshalJSON

func (this *RSAPrivateKey) MarshalJSON() ([]byte, error)

func (*RSAPrivateKey) UnmarshalJSON

func (this *RSAPrivateKey) UnmarshalJSON(data []byte) error

type RSAPublicKey

type RSAPublicKey struct {
	N *big.Int
	E int
}

func NewRSAPublicKey

func NewRSAPublicKey(key *rsa.PublicKey) *RSAPublicKey

func (*RSAPublicKey) MarshalJSON

func (this *RSAPublicKey) MarshalJSON() ([]byte, error)

func (*RSAPublicKey) UnmarshalJSON

func (this *RSAPublicKey) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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