Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(passphrase *string, encrypted []byte) ([32]byte, [64]byte, error)
- func Encode(secretKey [64]byte, passphrase *string) ([]byte, error)
- type EncodingContentEnum
- type EncodingTypeEnum
- type InterfacePair
- type InterfacePairs
- type MapPair
- type Pair
- func (p *Pair) Address() (string, error)
- func (p *Pair) DecodePkcs8(passphrase *string, encoded []byte) error
- func (p *Pair) EncodePkcs8(passphrase *string) ([]byte, error)
- func (p *Pair) GetMeta() (ktypes.Meta, error)
- func (p *Pair) IsLocked() bool
- func (p *Pair) Lock() error
- func (p *Pair) PublicKey() ([32]byte, error)
- func (p *Pair) SetMeta(meta ktypes.Meta) error
- func (p *Pair) Sign(message []byte) ([]byte, error)
- func (p *Pair) ToJSON(passphrase *string) ([]byte, error)
- func (p *Pair) Verify(message, signature []byte) (bool, error)
- type Pairs
- type State
Constants ¶
View Source
const ( // XSalsa20_Poly1305 ... XSalsa20_Poly1305 encodingTypeEnum = iota // None ... None )
View Source
const ( // PKCS8 ... PKCS8 encodingContentEnum = iota )
Variables ¶
View Source
var ( // DEFAULT_PKCS8_DIVIDER ... DEFAULT_PKCS8_DIVIDER = []byte{161, 35, 3, 33, 0} // DEFAULT_PKCS8_HEADER ... DEFAULT_PKCS8_HEADER = []byte{48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32} // DEFAULT_KEY_LENGTH ... DEFAULT_KEY_LENGTH = 32 // DEFAULT_SEED_OFFSET ... DEFAULT_SEED_OFFSET = len(DEFAULT_PKCS8_HEADER) // DEFAULT_DIV_OFFSET ... DEFAULT_DIV_OFFSET = DEFAULT_SEED_OFFSET + DEFAULT_KEY_LENGTH // DEFAULT_PUBLIC_OFFSET ... DEFAULT_PUBLIC_OFFSET = DEFAULT_SEED_OFFSET + DEFAULT_KEY_LENGTH + len(DEFAULT_PKCS8_DIVIDER) )
View Source
var ErrUnknownEncodingContent = errors.New("encoding content: unknown")
ErrUnknownEncodingContent ...
View Source
var ErrUnknownEncodingType = errors.New("encoding type: unknown")
ErrUnknownEncodingType ...
Functions ¶
Types ¶
type EncodingContentEnum ¶
type EncodingContentEnum interface { Type() encodingContentEnum String() string }
EncodingContentEnum ...
func AllEncodingContentEnums ¶
func AllEncodingContentEnums() []EncodingContentEnum
AllEncodingContentEnums returns all of the encoding content enums
func EncodingContentEnumFromString ¶
func EncodingContentEnumFromString(s string) (EncodingContentEnum, error)
EncodingContentEnumFromString ...
type EncodingTypeEnum ¶
type EncodingTypeEnum interface { Type() encodingTypeEnum String() string }
EncodingTypeEnum ...
func AllEncodingTypeEnums ¶
func AllEncodingTypeEnums() []EncodingTypeEnum
AllEncodingTypeEnums returns all of the encoding type enums
func EncodingTypeEnumFromString ¶
func EncodingTypeEnumFromString(s string) (EncodingTypeEnum, error)
EncodingTypeEnumFromString ...
type InterfacePair ¶
type InterfacePair interface { Address() (string, error) DecodePkcs8(password *string, encoded []byte) error EncodePkcs8(password *string) ([]byte, error) GetMeta() (ktypes.Meta, error) IsLocked() bool Lock() error PublicKey() ([32]byte, error) SetMeta(meta ktypes.Meta) error Sign(message []byte) ([]byte, error) // note: change to Marshal? ToJSON(password *string) ([]byte, error) Verify(message, signature []byte) (bool, error) }
InterfacePair ...
type InterfacePairs ¶
type InterfacePairs interface { Add(pair *Pair) (*Pair, error) All() ([]*Pair, error) Get(addr []byte) (*Pair, error) Remove(addr []byte) error }
InterfacePairs ...
type Pair ¶
type Pair struct { State *State // contains filtered or unexported fields }
Pair ...
func NewPair ¶
func NewPair(naclPub [32]byte, naclPriv [64]byte, meta ktypes.Meta, defaultEncoded []byte) (*Pair, error)
NewPair ...
func NewPairFromJSON ¶
NewPairFromJSON ...
func (*Pair) DecodePkcs8 ¶
DecodePkcs8 ...
func (*Pair) EncodePkcs8 ¶
EncodePkcs8 ...
Click to show internal directories.
Click to hide internal directories.