Documentation
¶
Index ¶
- Constants
- type KeyPair
- type NaClKeyPair
- func (k *NaClKeyPair) ExportPrivateKey() (string, error)
- func (k *NaClKeyPair) ExportPublicKey() (string, error)
- func (k *NaClKeyPair) ImportPrivateKey(key string) error
- func (k *NaClKeyPair) ImportPublicKey(key string) error
- func (k *NaClKeyPair) PublicKeyEquals(key string) bool
- func (k *NaClKeyPair) Sign(message string) (string, error)
- func (k *NaClKeyPair) Verify(message, sig string) error
- type PublicKeyAuthenticator
- func (auth *PublicKeyAuthenticator) AddPublicKey(key string)
- func (auth *PublicKeyAuthenticator) Authenticate(code string) error
- func (auth *PublicKeyAuthenticator) CleanupSessions()
- func (auth *PublicKeyAuthenticator) CreateSession() (string, error)
- func (auth *PublicKeyAuthenticator) GenerateCode(privateKey, sessionId string) (string, error)
- func (auth *PublicKeyAuthenticator) GetAlgo() (KeyPair, error)
- func (auth *PublicKeyAuthenticator) IsDirty() bool
- type RSAKeyPair
- func (k *RSAKeyPair) ExportPrivateKey() (string, error)
- func (k *RSAKeyPair) ExportPublicKey() (string, error)
- func (k *RSAKeyPair) ImportPrivateKey(key string) error
- func (k *RSAKeyPair) ImportPublicKey(key string) error
- func (k *RSAKeyPair) PublicKeyEquals(key string) bool
- func (k *RSAKeyPair) Sign(message string) (string, error)
- func (k *RSAKeyPair) Verify(message, sig string) error
Constants ¶
View Source
const ( AlgoRSA = "rsa" AlgoNaCl = "nacl" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NaClKeyPair ¶
type NaClKeyPair struct {
// contains filtered or unexported fields
}
func NewNaClKeyPair ¶
func NewNaClKeyPair() (*NaClKeyPair, error)
func (*NaClKeyPair) ExportPrivateKey ¶
func (k *NaClKeyPair) ExportPrivateKey() (string, error)
func (*NaClKeyPair) ExportPublicKey ¶
func (k *NaClKeyPair) ExportPublicKey() (string, error)
func (*NaClKeyPair) ImportPrivateKey ¶
func (k *NaClKeyPair) ImportPrivateKey(key string) error
func (*NaClKeyPair) ImportPublicKey ¶
func (k *NaClKeyPair) ImportPublicKey(key string) error
func (*NaClKeyPair) PublicKeyEquals ¶
func (k *NaClKeyPair) PublicKeyEquals(key string) bool
func (*NaClKeyPair) Verify ¶
func (k *NaClKeyPair) Verify(message, sig string) error
type PublicKeyAuthenticator ¶
type PublicKeyAuthenticator struct { Algo string `json:"algo"` PublicKeys []string `json:"public_keys"` Sessions map[string]time.Time `json:"sessions"` SessionTTL int `json:"session_ttl"` // contains filtered or unexported fields }
func NewPublicKeyAuthenticator ¶
func NewPublicKeyAuthenticator(algo string, sessionTTL time.Duration) *PublicKeyAuthenticator
func (*PublicKeyAuthenticator) AddPublicKey ¶
func (auth *PublicKeyAuthenticator) AddPublicKey(key string)
func (*PublicKeyAuthenticator) Authenticate ¶
func (auth *PublicKeyAuthenticator) Authenticate(code string) error
func (*PublicKeyAuthenticator) CleanupSessions ¶
func (auth *PublicKeyAuthenticator) CleanupSessions()
func (*PublicKeyAuthenticator) CreateSession ¶
func (auth *PublicKeyAuthenticator) CreateSession() (string, error)
func (*PublicKeyAuthenticator) GenerateCode ¶
func (auth *PublicKeyAuthenticator) GenerateCode(privateKey, sessionId string) (string, error)
func (*PublicKeyAuthenticator) GetAlgo ¶
func (auth *PublicKeyAuthenticator) GetAlgo() (KeyPair, error)
func (*PublicKeyAuthenticator) IsDirty ¶
func (auth *PublicKeyAuthenticator) IsDirty() bool
type RSAKeyPair ¶
type RSAKeyPair struct {
// contains filtered or unexported fields
}
func NewRSAKeyPair ¶
func NewRSAKeyPair(bits int) (*RSAKeyPair, error)
func (*RSAKeyPair) ExportPrivateKey ¶
func (k *RSAKeyPair) ExportPrivateKey() (string, error)
func (*RSAKeyPair) ExportPublicKey ¶
func (k *RSAKeyPair) ExportPublicKey() (string, error)
func (*RSAKeyPair) ImportPrivateKey ¶
func (k *RSAKeyPair) ImportPrivateKey(key string) error
func (*RSAKeyPair) ImportPublicKey ¶
func (k *RSAKeyPair) ImportPublicKey(key string) error
func (*RSAKeyPair) PublicKeyEquals ¶
func (k *RSAKeyPair) PublicKeyEquals(key string) bool
func (*RSAKeyPair) Verify ¶
func (k *RSAKeyPair) Verify(message, sig string) error
Click to show internal directories.
Click to hide internal directories.