Documentation ¶
Index ¶
- func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GenerateSharedKey(publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey) ([]byte, error)
- func MarshalPrivateKey(privateKey ed25519.PrivateKey) ([]byte, error)
- func MarshalPublicKey(publicKey ed25519.PublicKey) ([]byte, error)
- func PrivateKeyToCurve25519(ret *[32]byte, privateKey ed25519.PrivateKey)
- func PublicKeyToCurve25519(ret *[32]byte, publicKey ed25519.PublicKey) error
- func Sign(privateKey ed25519.PrivateKey, data []byte) []byte
- func UnmarshalPrivateKey(data []byte) (ed25519.PrivateKey, error)
- func UnmarshalPublicKey(data []byte) (ed25519.PublicKey, error)
- func Verify(publicKey ed25519.PublicKey, data, signature []byte) bool
- type Signer
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateKey generates a public/private key pair for Ed25519
func GenerateSharedKey ¶
GenerateSharedKey generates a shared key using ECDH exchange between a public and private key
func MarshalPrivateKey ¶
func MarshalPrivateKey(privateKey ed25519.PrivateKey) ([]byte, error)
MarshalPrivateKey marshals a private key. For Ed25519, this is a no-op
func MarshalPublicKey ¶
MarshalPublicKey marshals a public key. For Ed25519, this is a no-op
func PrivateKeyToCurve25519 ¶
func PrivateKeyToCurve25519(ret *[32]byte, privateKey ed25519.PrivateKey)
PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding curve25519 private key such that the resulting curve25519 public key will equal the result from PublicKeyToCurve25519.
func PublicKeyToCurve25519 ¶
PublicKeyToCurve25519 converts an Ed25519 public key into the curve25519 public key that would be generated from the same private key.
func Sign ¶
func Sign(privateKey ed25519.PrivateKey, data []byte) []byte
Sign signs a message using Ed25519
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(data []byte) (ed25519.PrivateKey, error)
UnmarshalPrivateKey unmarshal a private key. For Ed25519, this is a no-op
func UnmarshalPublicKey ¶
UnmarshalPublicKey unmarshal a public key. For Ed25519, this is a no-op
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}