Documentation ¶
Overview ¶
github.com/steowens/crypton - Core classes for crypton identity and message system.
Copyright (C) 2023 Stephen Owens
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
github.com/steowens/crypton - Core classes for crypton identity and message system.
Copyright (C) 2023 Stephen Owens
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
github.com/steowens/crypton - Core classes for crypton identity and message system.
Copyright (C) 2023 Stephen Owens
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- func GetAddressFromPublicKey(pubKey *ecdsa.PublicKey) string
- func GetPublicKeyFromSignature(hashable string, signature []byte) (pubKey *ecdsa.PublicKey, err error)
- type AESDecrptionStream
- type AESEncryptionStream
- type Crypton
- func (c *Crypton) DecryptWithPassword(password string, value *PasswordEncryptedValue) (plainTextBytes []byte, err error)
- func (c *Crypton) DeformatPassword(input string) string
- func (c *Crypton) EncryptWithPassword(password string, plainTextBytes []byte) (*PasswordEncryptedValue, error)
- func (c *Crypton) FormatPassword(password string) string
- func (c *Crypton) GeneratePassword(quartets int) (string, error)
- type Identity
- type KeyAgreementKey
- type PasswordEncryptedValue
- type PublicProfile
- type Registration
- type SigningKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddressFromPublicKey ¶
Types ¶
type AESDecrptionStream ¶
type AESDecrptionStream struct { IV []byte // contains filtered or unexported fields }
func NewAESDecryptionStream ¶
type AESEncryptionStream ¶
type AESEncryptionStream struct { IV []byte // contains filtered or unexported fields }
func NewAESEncryptionStream ¶
func NewAESEncryptionStream(key []byte, plainTextReader io.Reader) (stream *AESEncryptionStream, err error)
type Crypton ¶
type Crypton struct { }
func (*Crypton) DecryptWithPassword ¶
func (c *Crypton) DecryptWithPassword(password string, value *PasswordEncryptedValue) (plainTextBytes []byte, err error)
func (*Crypton) DeformatPassword ¶
Strips ' ' chars from input string
func (*Crypton) EncryptWithPassword ¶
func (c *Crypton) EncryptWithPassword(password string, plainTextBytes []byte) (*PasswordEncryptedValue, error)
func (*Crypton) FormatPassword ¶
Inserts ' ' in password every 5 characters for readability
type Identity ¶
type Identity struct { ID string PublicName string Domain string SigKey SigningKey }
func NewIdentity ¶
func (*Identity) ToRegistration ¶
func (identity *Identity) ToRegistration() (registration *Registration, err error)
type KeyAgreementKey ¶
type KeyAgreementKey struct { Unlocked bool PrivateKey *PasswordEncryptedValue PublicKey string SeqNum int64 ActiveFrom int64 ActiveTo int64 // contains filtered or unexported fields }
func NewKeyAgreementKey ¶
func NewKeyAgreementKey() (key *KeyAgreementKey, err error)
func (*KeyAgreementKey) Lock ¶
func (key *KeyAgreementKey) Lock(password string) (locked *KeyAgreementKey, err error)
func (*KeyAgreementKey) Unlock ¶
func (key *KeyAgreementKey) Unlock(password string) (unlocked *KeyAgreementKey, err error)
type PasswordEncryptedValue ¶
type PublicProfile ¶
func (*PublicProfile) Hashable ¶
func (profile *PublicProfile) Hashable() (hashable string)
func (*PublicProfile) Valid ¶
func (profile *PublicProfile) Valid() bool
type Registration ¶
type Registration struct { Profile PublicProfile Signature string }
func (*Registration) GetAddress ¶
func (registration *Registration) GetAddress() (address string, err error)
func (*Registration) GetPublicKey ¶
func (registration *Registration) GetPublicKey() (pubKey *ecdsa.PublicKey, err error)
type SigningKey ¶
type SigningKey struct { PrivateKey *PasswordEncryptedValue // contains filtered or unexported fields }
func NewSigningKey ¶
func NewSigningKey(password string) (unlocked *SigningKey, err error)
func (*SigningKey) GetAddress ¶
func (sk *SigningKey) GetAddress() (address string, err error)
func (*SigningKey) Unlock ¶
func (sk *SigningKey) Unlock(password string) (unlocked *SigningKey, err error)
Click to show internal directories.
Click to hide internal directories.