Documentation
¶
Index ¶
- Constants
- Variables
- func Decrypt(data []byte, passphrase string) ([]byte, error)
- func Encrypt(data []byte, passphrase string) ([]byte, error)
- type SignatureAlgorithm
- func (s *SignatureAlgorithm) GenKey() (crypto.PublicKey, crypto.PrivateKey, error)
- func (s *SignatureAlgorithm) MarshalJSON() ([]byte, error)
- func (s *SignatureAlgorithm) Name() string
- func (s *SignatureAlgorithm) Sign(priv crypto.PrivateKey, buf []byte) ([]byte, error)
- func (s *SignatureAlgorithm) UnmarshalJSON(data []byte) error
- func (s *SignatureAlgorithm) Verify(pub crypto.PublicKey, message, sig []byte) (bool, error)
- func (s *SignatureAlgorithm) Version() uint32
Constants ¶
View Source
const (
Ed25519 string = "vega/ed25519"
)
Variables ¶
View Source
var ( // ErrBadED25519PrivateKeyLength is returned if a private key with incorrect length is supplied. ErrBadED25519PrivateKeyLength = errors.New("bad ed25519 private key length") // ErrBadED25519PublicKeyLength is returned if a public key with incorrect length is supplied. ErrBadED25519PublicKeyLength = errors.New("bad ed25519 public key length") )
View Source
var (
ErrUnsupportedSignatureAlgorithm = errors.New("unsupported signature algorithm")
)
Functions ¶
Types ¶
type SignatureAlgorithm ¶
type SignatureAlgorithm struct {
// contains filtered or unexported fields
}
func NewEd25519 ¶
func NewEd25519() SignatureAlgorithm
func NewSignatureAlgorithm ¶
func NewSignatureAlgorithm(algo string) (SignatureAlgorithm, error)
func (*SignatureAlgorithm) GenKey ¶
func (s *SignatureAlgorithm) GenKey() (crypto.PublicKey, crypto.PrivateKey, error)
func (*SignatureAlgorithm) MarshalJSON ¶
func (s *SignatureAlgorithm) MarshalJSON() ([]byte, error)
func (*SignatureAlgorithm) Name ¶
func (s *SignatureAlgorithm) Name() string
func (*SignatureAlgorithm) Sign ¶
func (s *SignatureAlgorithm) Sign(priv crypto.PrivateKey, buf []byte) ([]byte, error)
func (*SignatureAlgorithm) UnmarshalJSON ¶
func (s *SignatureAlgorithm) UnmarshalJSON(data []byte) error
func (*SignatureAlgorithm) Version ¶
func (s *SignatureAlgorithm) Version() uint32
Click to show internal directories.
Click to hide internal directories.