Documentation ¶
Overview ¶
Package ecdsa provides ecdsa crypto related implementations.
Package ecdsa provides ecdsa crypto related implementations.
Package ecdsa provides ecdsa crypto related implementations.
Package ecdsa provides ecdsa crypto related implementations.
Index ¶
- type KeyPair
- func (this *KeyPair) Generate(curve elliptic.Curve) error
- func (this *KeyPair) GetKeyPair() (privateKey PrivateKey, publicKey PublicKey)
- func (this *KeyPair) SetKeyPair(privateKey PrivateKey, publicKey PublicKey)
- func (this *KeyPair) Sign(message string) (Signature, error)
- func (this *KeyPair) Verify(message string, signature Signature) bool
- type PrivateKey
- func (this *PrivateKey) Get() *ecdsa.PrivateKey
- func (this *PrivateKey) GetCurve() elliptic.Curve
- func (this *PrivateKey) GetPemEC() (string, error)
- func (this *PrivateKey) GetPublicKey() PublicKey
- func (this *PrivateKey) Set(privateKey *ecdsa.PrivateKey)
- func (this *PrivateKey) SetCurve(curve elliptic.Curve) error
- func (this *PrivateKey) SetPemEC(pemEC string) error
- func (this *PrivateKey) Sign(message string) (Signature, error)
- func (this *PrivateKey) Verify(message string, signature Signature) bool
- type PublicKey
- func (this *PublicKey) Get() ecdsa.PublicKey
- func (this *PublicKey) GetPemPKIX() (string, error)
- func (this *PublicKey) GetSsh() (string, error)
- func (this *PublicKey) GetSshPublicKey() (ssh.PublicKey, error)
- func (this *PublicKey) Set(publicKey ecdsa.PublicKey)
- func (this *PublicKey) SetPemPKIX(pemPKIX string) error
- func (this *PublicKey) SetSsh(sshKey string) error
- func (this *PublicKey) SetSshPublicKey(publicKey ssh.PublicKey) error
- func (this *PublicKey) Verify(message string, signature Signature) bool
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
KeyPair is struct that provides key pair related methods.
func (*KeyPair) Generate ¶
Generate is to generate a key pair.
ex) err := keyPair.Generate(elliptic.P384())
func (*KeyPair) GetKeyPair ¶
func (this *KeyPair) GetKeyPair() (privateKey PrivateKey, publicKey PublicKey)
GetKeyPair is to get a key pair.
ex) privateKey, publicKey := keyPair.GetKeyPair()
func (*KeyPair) SetKeyPair ¶
func (this *KeyPair) SetKeyPair(privateKey PrivateKey, publicKey PublicKey)
SetKeyPair is to set a key pair.
ex) keyPair.SetKeyPair(privateKey, publicKey)
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey is struct that provides private key related methods.
func (*PrivateKey) Get ¶
func (this *PrivateKey) Get() *ecdsa.PrivateKey
Get is to get a *ecdsa.PrivateKey.
ex) key := privateKey.Get()
func (*PrivateKey) GetCurve ¶
func (this *PrivateKey) GetCurve() elliptic.Curve
GetCurve is to get a elliptic.Curve.
ex) curve := privateKey.GetCurve()
func (*PrivateKey) GetPemEC ¶
func (this *PrivateKey) GetPemEC() (string, error)
GetPemEC is to get a string in Pem/EC format.
ex) pemEC, err := privateKey.GetPemEC()
func (*PrivateKey) GetPublicKey ¶
func (this *PrivateKey) GetPublicKey() PublicKey
GetPublicKey is to get a PublicKey.
ex) key := privateKey.GetPublicKey()
func (*PrivateKey) Set ¶
func (this *PrivateKey) Set(privateKey *ecdsa.PrivateKey)
Set is to set a *ecdsa.PrivateKey.
ex) privateKey.Set(key)
func (*PrivateKey) SetCurve ¶
func (this *PrivateKey) SetCurve(curve elliptic.Curve) error
SetCurve is to set the primary key using Curve.
ex) err := privateKey.SetCurve(elliptic.P384())
func (*PrivateKey) SetPemEC ¶
func (this *PrivateKey) SetPemEC(pemEC string) error
SetPemEC is to set the primary key using a string in Pem/EC format.
ex) err := privateKey.SetPemEC(pemEC)
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey is struct that provides public key related methods.
func (*PublicKey) GetPemPKIX ¶
GetPemPKIX is to get a string in Pem/PKIX format.
ex) pemPKIX, err := publicKey.GetPemPKIX()
func (*PublicKey) GetSsh ¶
GetSsh is to get a string in ssh format.
ex) sshKey, err := publicKey.GetSsh()
func (*PublicKey) GetSshPublicKey ¶
GetSshPublicKey is to get a ssh.PublicKey.
ex) key, err := publicKey.GetSshPublicKey()
func (*PublicKey) SetPemPKIX ¶
SetPemPKIX is to set the public key using a string in Pem/PKIX format.
ex) err := publicKey.SetPemPKIX(pemAsn1)
func (*PublicKey) SetSsh ¶
SetSsh is to set the public key using a string in ssh format.
ex) err := publicKey.SetSsh(sshKey)
func (*PublicKey) SetSshPublicKey ¶
SetSshPublicKey is to set the public key using ssh.PublicKey.
ex) err := publicKey.SetSshPublicKey(key)