Documentation ¶
Index ¶
- Variables
- func NewNoMaybeReader(reader io.Reader) io.Reader
- type PublicKey
- type SecretKey
- func (k *SecretKey) Decrypt(data []byte) ([]byte, error)
- func (k *SecretKey) EncodePublicKey() string
- func (k *SecretKey) GetPublicKey() *PublicKey
- func (k *SecretKey) MarshalPublicKey() []byte
- func (k *SecretKey) MarshalSecretKey() []byte
- func (k *SecretKey) Sign(msg []byte) ([]byte, error)
- func (k *SecretKey) ToID(code byte) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Base64Encode = base64.RawURLEncoding Base32Encode = base32.StdEncoding.WithPadding(base32.NoPadding) ErrInvalidKey = errors.New("InvalidKey") ErrInvalidMessage = errors.New("InvalidMessage") )
variable define
Functions ¶
Types ¶
type PublicKey ¶
PublicKey of ECDSA
func LoadPublicKey ¶
LoadPublicKey from binary data
func (*PublicKey) MarshalPublicKey ¶
MarshalPublicKey return binary public key
type SecretKey ¶
type SecretKey struct {
ecdsa.PrivateKey
}
SecretKey of ECDSA
func GenerateSecretKey ¶
GenerateSecretKey with secret key
func LoadSecretKey ¶ added in v0.9.0
LoadSecretKey from binary data
func (*SecretKey) EncodePublicKey ¶
EncodePublicKey return base64 public key from secret key
func (*SecretKey) GetPublicKey ¶
GetPublicKey from secret key
func (*SecretKey) MarshalPublicKey ¶
MarshalPublicKey return binary public key
func (*SecretKey) MarshalSecretKey ¶ added in v0.9.0
MarshalSecretKey return binary secret key
Click to show internal directories.
Click to hide internal directories.