Documentation ¶
Index ¶
- Constants
- Variables
- func Burn(data ...[]byte)
- func CalculatePasswordSecurityLevel(password string, iterations int) int
- func Random() io.Reader
- func RandomBytes(n int) ([]byte, error)
- func SetCustomRNG(randReader io.Reader)
- func SetDefaultKeySize(sizeInBytes int)
- func SetMinimumSecurityLevel(securityLevel int)
- func SetPasswordCallbacks(createPassword func(signet *Signet, minSecurityLevel int) error, ...)
- func SuitesMap() map[string]*Suite
- type Envelope
- func (e *Envelope) Check(trustStore TrustStore) error
- func (e *Envelope) CleanSignets()
- func (e *Envelope) Correspondence(trustStore TrustStore) (*Session, error)
- func (e *Envelope) Export(short bool) (textFormat string, err error)
- func (e *Envelope) LoadSuite() error
- func (e *Envelope) LoopRecipients(scheme string, fn func(*Signet) error) error
- func (e *Envelope) LoopSecrets(scheme string, fn func(*Signet) error) error
- func (e *Envelope) LoopSenders(scheme string, fn func(*Signet) error) error
- func (e *Envelope) PrepareSignets(storage TrustStore) error
- func (e *Envelope) ReloadSuite() error
- func (e *Envelope) Suite() *Suite
- func (e *Envelope) ToBase58() (string, error)
- func (e *Envelope) ToBytes() ([]byte, error)
- func (e *Envelope) WireCorrespondence(trustStore TrustStore) (*Session, error)
- type Helper
- func (h *Helper) Burn(data ...[]byte)
- func (h *Helper) DefaultSymmetricKeySize() int
- func (h *Helper) FillNewSessionKey(key []byte) error
- func (h *Helper) MaxSecurityLevel() int
- func (h *Helper) NewSessionKey() ([]byte, error)
- func (h *Helper) NewSessionNonce() ([]byte, error)
- func (h *Helper) Random() io.Reader
- func (h *Helper) RandomBytes(n int) ([]byte, error)
- func (h *Helper) SecurityLevel() int
- type Letter
- func (letter *Letter) Envelope(requirements *Requirements) (*Envelope, error)
- func (letter *Letter) Open(requirements *Requirements, trustStore TrustStore) ([]byte, error)
- func (letter *Letter) ToDSD(dsdFormat uint8) ([]byte, error)
- func (letter *Letter) ToFileFormat() (*container.Container, error)
- func (letter *Letter) ToJSON() ([]byte, error)
- func (letter *Letter) ToWire() (*container.Container, error)
- func (letter *Letter) Verify(requirements *Requirements, trustStore TrustStore) error
- func (letter *Letter) WireCorrespondence(trustStore TrustStore) (*Session, error)
- type MemTrustStore
- func (mts *MemTrustStore) DeleteSignet(id string, recipient bool) error
- func (mts *MemTrustStore) GetSignet(id string, recipient bool) (*Signet, error)
- func (mts *MemTrustStore) SelectSignets(filter uint8, schemes ...string) ([]*Signet, error)
- func (mts *MemTrustStore) StoreSignet(signet *Signet) error
- type Requirements
- func (requirements *Requirements) Add(attribute uint8) *Requirements
- func (requirements *Requirements) CheckComplianceTo(requirement *Requirements) error
- func (requirements *Requirements) Empty() bool
- func (requirements *Requirements) Has(attribute uint8) bool
- func (requirements *Requirements) Remove(attribute uint8) *Requirements
- func (requirements *Requirements) SerializeToNoSpec() string
- func (requirements *Requirements) ShortString() string
- func (requirements *Requirements) String() string
- type Seal
- type Session
- type Signet
- func GenerateSignet(toolID string, securityLevel int) (*Signet, error)
- func KeyFromTextFormat(textFormat string) (*Signet, error)
- func NewSignetBase(tool *tools.Tool) *Signet
- func RecipientFromTextFormat(textFormat string) (*Signet, error)
- func SenderFromTextFormat(textFormat string) (*Signet, error)
- func SignetFromBase58(base58Encoded string) (*Signet, error)
- func SignetFromBytes(data []byte) (*Signet, error)
- func (signet *Signet) AsRecipient() (*Signet, error)
- func (signet *Signet) AssignUUID() error
- func (signet *Signet) Backup(short bool) (textFormat string, err error)
- func (signet *Signet) Burn() error
- func (signet *Signet) Export(short bool) (textFormat string, err error)
- func (signet *Signet) GenerateKey() error
- func (signet *Signet) GetStoredKey() (key []byte, public bool)
- func (signet *Signet) LoadKey() error
- func (signet *Signet) PrivateKey() crypto.PrivateKey
- func (signet *Signet) PublicKey() crypto.PublicKey
- func (signet *Signet) SetLoadedKeys(pubKey crypto.PublicKey, privKey crypto.PrivateKey)
- func (signet *Signet) SetStoredKey(key []byte, public bool)
- func (signet *Signet) StoreKey() error
- func (signet *Signet) ToBase58() (string, error)
- func (signet *Signet) ToBytes() ([]byte, error)
- func (signet *Signet) Tool() (*tools.Tool, error)
- func (signet *Signet) Verify() error
- type SignetInfo
- type Suite
- type TrustStore
- type WireSession
Constants ¶
const ( ExportSenderKeyword = "sender" ExportSenderPrefix = "sender:" ExportRecipientKeyword = "recipient" ExportRecipientPrefix = "recipient:" ExportKeyKeyword = "secret" ExportKeyPrefix = "secret:" ExportEnvelopeKeyword = "envelope" ExportEnvelopePrefix = "envelope:" )
Keywords and Prefixes for the export text format.
const ( Confidentiality uint8 = iota Integrity RecipientAuthentication SenderAuthentication )
Security requirements of a letter.
const ( SignetSchemePassword = "pw" SignetSchemeKey = "key" )
Special signet types.
const ( SuiteStatusDeprecated uint8 = 0 SuiteStatusPermitted uint8 = 1 SuiteStatusRecommended uint8 = 2 )
Suite status options.
const ( FilterAny uint8 = iota FilterSignetOnly FilterRecipientOnly )
TrustStore filter options.
Variables ¶
var ( RecommendedNetwork = []string{"ECDH-X25519", "HKDF(SHA2-256)", "CHACHA20-POLY1305"} RecommendedStoragePassword = []string{"PBKDF2-SHA2-256", "HKDF(SHA2-256)", "CHACHA20-POLY1305"} RecommendedStorageKey = []string{"HKDF(SHA2-256)", "CHACHA20-POLY1305"} RecommendedStorageRecipient = []string{"ECDH-X25519", "HKDF(SHA2-256)", "CHACHA20-POLY1305"} RecommendedSigning = []string{"Ed25519(SHA2-256)"} )
Currently recommended toolsets.
var ( // ErrIntegrityViolation is returned when the integrity was found the be violated. ErrIntegrityViolation = errors.New("integrity violation") // ErrConfidentialityViolation is returned when the confidentiality was found the be violated. ErrConfidentialityViolation = errors.New("confidentiality violation") // ErrAuthenticityViolation is returned when the authenticity was found the be violated. ErrAuthenticityViolation = errors.New("authenticity violation") // ErrInsufficientRandom is returned if the configured RNG cannot deliver enough data. ErrInsufficientRandom = errors.New("not enough random data available from source") )
var ( // SuiteKey is a cipher suite for encryption with a key. SuiteKey = SuiteKeyV1 // SuitePassword is a cipher suite for encryption with a password. SuitePassword = SuitePasswordV1 // SuiteRcptOnly is a cipher suite for encrypting for someone, but without verifying the sender/source. SuiteRcptOnly = SuiteRcptOnlyV1 // SuiteSign is a cipher suite for signing (no encryption). SuiteSign = SuiteSignV1 // SuiteSignFile is a cipher suite for signing files (no encryption). SuiteSignFile = SuiteSignFileV1 // SuiteComplete is a cipher suite for both encrypting for someone and signing. SuiteComplete = SuiteCompleteV1 // SuiteWire is a cipher suite for network communication, including authentication of the server, but not the client. SuiteWire = SuiteWireV1 )
Currently Recommended Suites.
var ( // SuiteKeyV1 is a cipher suite for encryption with a key. SuiteKeyV1 = registerSuite(&Suite{ ID: "key_v1", Tools: []string{"HKDF(BLAKE2b-256)", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuitePasswordV1 is a cipher suite for encryption with a password. SuitePasswordV1 = registerSuite(&Suite{ ID: "pw_v1", Tools: []string{"SCRYPT-20", "HKDF(BLAKE2b-256)", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuiteRcptOnlyV1 is a cipher suite for encrypting for someone, but without verifying the sender/source. SuiteRcptOnlyV1 = registerSuite(&Suite{ ID: "rcpt_v1", Tools: []string{"ECDH-X25519", "HKDF(BLAKE2b-256)", "CHACHA20-POLY1305"}, Provides: NewRequirements().Remove(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuiteSignV1 is a cipher suite for signing (no encryption). SuiteSignV1 = registerSuite(&Suite{ ID: "sign_v1", Tools: []string{"Ed25519(BLAKE2b-256)"}, Provides: newEmptyRequirements().Add(Integrity).Add(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuiteSignFileV1 is a cipher suite for signing files (no encryption). // SHA2_256 is chosen for better compatibility with other tool sets and workflows. SuiteSignFileV1 = registerSuite(&Suite{ ID: "signfile_v1", Tools: []string{"Ed25519(SHA2-256)"}, Provides: newEmptyRequirements().Add(Integrity).Add(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuiteCompleteV1 is a cipher suite for both encrypting for someone and signing. SuiteCompleteV1 = registerSuite(&Suite{ ID: "v1", Tools: []string{"ECDH-X25519", "Ed25519(BLAKE2b-256)", "HKDF(BLAKE2b-256)", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusRecommended, }) // SuiteWireV1 is a cipher suite for network communication, including authentication of the server, but not the client. SuiteWireV1 = registerSuite(&Suite{ ID: "w1", Tools: []string{"ECDH-X25519", "HKDF(BLAKE2b-256)", "CHACHA20-POLY1305"}, Provides: NewRequirements().Remove(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusRecommended, }) )
var ( // SuiteKeyV2 is a cipher suite for encryption with a key. SuiteKeyV2 = registerSuite(&Suite{ ID: "key_v2", Tools: []string{"BLAKE3-KDF", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuitePasswordV2 is a cipher suite for encryption with a password. SuitePasswordV2 = registerSuite(&Suite{ ID: "pw_v2", Tools: []string{"SCRYPT-20", "BLAKE3-KDF", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuiteRcptOnlyV2 is a cipher suite for encrypting for someone, but without verifying the sender/source. SuiteRcptOnlyV2 = registerSuite(&Suite{ ID: "rcpt_v2", Tools: []string{"ECDH-X25519", "BLAKE3-KDF", "CHACHA20-POLY1305"}, Provides: NewRequirements().Remove(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuiteSignV2 is a cipher suite for signing (no encryption). SuiteSignV2 = registerSuite(&Suite{ ID: "sign_v2", Tools: []string{"Ed25519(BLAKE3)"}, Provides: newEmptyRequirements().Add(Integrity).Add(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuiteSignFileV2 is a cipher suite for signing files (no encryption). // SHA2_256 is chosen for better compatibility with other tool sets and workflows. SuiteSignFileV2 = registerSuite(&Suite{ ID: "signfile_v2", Tools: []string{"Ed25519(BLAKE3)"}, Provides: newEmptyRequirements().Add(Integrity).Add(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuiteCompleteV2 is a cipher suite for both encrypting for someone and signing. SuiteCompleteV2 = registerSuite(&Suite{ ID: "v2", Tools: []string{"ECDH-X25519", "Ed25519(BLAKE3)", "BLAKE3-KDF", "CHACHA20-POLY1305"}, Provides: NewRequirements(), SecurityLevel: 128, Status: SuiteStatusPermitted, }) // SuiteWireV2 is a cipher suite for network communication, including authentication of the server, but not the client. SuiteWireV2 = registerSuite(&Suite{ ID: "w2", Tools: []string{"ECDH-X25519", "BLAKE3-KDF", "CHACHA20-POLY1305"}, Provides: NewRequirements().Remove(SenderAuthentication), SecurityLevel: 128, Status: SuiteStatusPermitted, }) )
var ( ErrSignetNotFound = errors.New("could not find signet") ErrEnvelopeNotFound = errors.New("could not find envelope") )
TrustStore errors.
var ErrIncompatibleFileFormatVersion = errors.New("incompatible file format version")
ErrIncompatibleFileFormatVersion is returned when an incompatible wire format is encountered.
var ErrIncompatibleWireFormatVersion = errors.New("incompatible wire format version")
ErrIncompatibleWireFormatVersion is returned when an incompatible wire format is encountered.
Functions ¶
func Burn ¶
func Burn(data ...[]byte)
Burn gets rid of the given []byte slice(s). This is currently ineffective, see known issues in the project's README.
func CalculatePasswordSecurityLevel ¶
CalculatePasswordSecurityLevel calculates the security level of the given password and iterations of the pbkdf algorithm.
func Random ¶
Random returns the io.Reader for reading randomness. By default, it uses crypto/rand.Reader.
func RandomBytes ¶
RandomBytes returns the specified amount of random bytes in a []byte slice. By default, it uses crypto/rand.Reader.
func SetCustomRNG ¶
SetCustomRNG sets a custom RNG to be used with jess.
func SetDefaultKeySize ¶
func SetDefaultKeySize(sizeInBytes int)
SetDefaultKeySize sets a global default key size to be used as a fallback value. This will be only used if the default key size could not be derived from already present information.
func SetMinimumSecurityLevel ¶
func SetMinimumSecurityLevel(securityLevel int)
SetMinimumSecurityLevel sets a global minimum security level. Jess will refuse any operations that violate this security level.
Types ¶
type Envelope ¶
type Envelope struct { Version uint8 Name string SuiteID string // Secret keys and passwords Secrets []*Signet // Sender related signets // When closing: private keys for signatures // When opening: public keys for signatures Senders []*Signet // Recipient related signets // When closing: public keys for key exchange or key encapsulation // When opening: private keys for key exchange or key encapsulation Recipients []*Signet // SecurityLevel is the security level of the envelope when it was created SecurityLevel int // contains filtered or unexported fields }
Envelope holds configuration for jess to put data into a letter.
func EnvelopeFromBase58 ¶ added in v0.3.0
EnvelopeFromBase58 parses and loads a base58 encoded serialized envelope.
func EnvelopeFromBytes ¶ added in v0.3.0
EnvelopeFromBytes parses and loads a serialized envelope.
func EnvelopeFromTextFormat ¶ added in v0.3.0
EnvelopeFromTextFormat loads an envelope from the text format.
func NewUnconfiguredEnvelope ¶
func NewUnconfiguredEnvelope() *Envelope
NewUnconfiguredEnvelope returns an unconfigured, but slightly initialized envelope.
func (*Envelope) Check ¶
func (e *Envelope) Check(trustStore TrustStore) error
Check returns whether the envelope is valid and can be used as is.
func (*Envelope) CleanSignets ¶ added in v0.3.0
func (e *Envelope) CleanSignets()
CleanSignets cleans all the signets from all the non-necessary data as well as key material. This is for preparing for serializing and saving the signet.
func (*Envelope) Correspondence ¶
func (e *Envelope) Correspondence(trustStore TrustStore) (*Session, error)
Correspondence returns a new session configured with the envelope.
func (*Envelope) LoopRecipients ¶
LoopRecipients loops over all recipient signets of the given scheme.
func (*Envelope) LoopSecrets ¶
LoopSecrets loops over all secrets of the given scheme.
func (*Envelope) LoopSenders ¶
LoopSenders loops over all sender signets of the given scheme.
func (*Envelope) PrepareSignets ¶
func (e *Envelope) PrepareSignets(storage TrustStore) error
PrepareSignets checks that all signets of the envelope are ready to use. It will fetch referenced signets and load the keys.
func (*Envelope) ReloadSuite ¶
ReloadSuite forces reloading the suite specified in the envelope.
func (*Envelope) ToBase58 ¶ added in v0.3.0
ToBase58 serializes the envelope and encodes it with base58.
func (*Envelope) WireCorrespondence ¶
func (e *Envelope) WireCorrespondence(trustStore TrustStore) (*Session, error)
WireCorrespondence returns a new wire session (live communication) configured with the envelope.
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper provides a basic interface for tools to access session properties and functionality.
func (*Helper) Burn ¶
Burn gets rid of the given []byte slice(s). This is currently ineffective, see known issues in the project's README.
func (*Helper) DefaultSymmetricKeySize ¶
DefaultSymmetricKeySize returns the default key size for this session.
func (*Helper) FillNewSessionKey ¶
FillNewSessionKey fills the given []byte slice with a new session key (or nonce).
func (*Helper) MaxSecurityLevel ¶
MaxSecurityLevel returns the (highest) security level for this session.
func (*Helper) NewSessionKey ¶
NewSessionKey returns a new session key in tool's specified length.
func (*Helper) NewSessionNonce ¶
NewSessionNonce returns a new session nonce in tool's specified length.
func (*Helper) RandomBytes ¶
RandomBytes returns the specified amount of random bytes in a []byte slice.
func (*Helper) SecurityLevel ¶
SecurityLevel returns the effective (ie. lowest) security level for this session.
type Letter ¶
type Letter struct { Version uint8 // signed, MAC'd (may not exist when wired) SuiteID string // signed, MAC'd (may not exist when wired) Nonce []byte // signed, MAC'd Keys []*Seal `json:",omitempty"` // signed, MAC'd Data []byte `json:",omitempty"` // signed, MAC'd Mac []byte `json:",omitempty"` // signed Signatures []*Seal `json:",omitempty"` // Flags for wire protocol ApplyKeys bool `json:",omitempty"` // MAC'd }
Letter is the data format for encrypted data at rest or in transit.
func LetterFromDSD ¶
LetterFromDSD loads a dsd-serialized letter.
func LetterFromFileFormat ¶
LetterFromFileFormat parses a letter stored as a file.
func LetterFromJSON ¶
LetterFromJSON loads a json-serialized letter.
func LetterFromWire ¶
LetterFromWire parses a letter sent over a network connection.
func LetterFromWireData
deprecated
func (*Letter) Envelope ¶
func (letter *Letter) Envelope(requirements *Requirements) (*Envelope, error)
Envelope returns an envelope built from the letter, configured for opening it.
func (*Letter) Open ¶
func (letter *Letter) Open(requirements *Requirements, trustStore TrustStore) ([]byte, error)
Open creates a session and opens the letter in one step.
func (*Letter) ToFileFormat ¶
ToFileFormat serializes the letter for storing it as a file.
func (*Letter) Verify ¶
func (letter *Letter) Verify(requirements *Requirements, trustStore TrustStore) error
Verify creates a session and verifies the letter in one step.
func (*Letter) WireCorrespondence ¶
func (letter *Letter) WireCorrespondence(trustStore TrustStore) (*Session, error)
WireCorrespondence creates a wire session (communication over a network connection) from a letter.
type MemTrustStore ¶
type MemTrustStore struct {
// contains filtered or unexported fields
}
MemTrustStore is a simple trust store using a Go map as backend.
func NewMemTrustStore ¶
func NewMemTrustStore() *MemTrustStore
NewMemTrustStore returns a new in-memory TrustStore.
func (*MemTrustStore) DeleteSignet ¶
func (mts *MemTrustStore) DeleteSignet(id string, recipient bool) error
DeleteSignet deletes the Signet or Recipient with the given ID.
func (*MemTrustStore) GetSignet ¶
func (mts *MemTrustStore) GetSignet(id string, recipient bool) (*Signet, error)
GetSignet returns the Signet with the given ID.
func (*MemTrustStore) SelectSignets ¶
func (mts *MemTrustStore) SelectSignets(filter uint8, schemes ...string) ([]*Signet, error)
SelectSignets returns a selection of the signets in the trust store. Results are filtered by tool/algorithm and whether it you're looking for a signet (private key) or a recipient (public key).
func (*MemTrustStore) StoreSignet ¶
func (mts *MemTrustStore) StoreSignet(signet *Signet) error
StoreSignet stores a Signet in the TrustStore.
type Requirements ¶
type Requirements struct {
// contains filtered or unexported fields
}
Requirements describe security properties.
func NewRequirements ¶
func NewRequirements() *Requirements
NewRequirements returns an attribute instance with all requirements.
func ParseRequirementsFromNoSpec ¶
func ParseRequirementsFromNoSpec(no string) (*Requirements, error)
ParseRequirementsFromNoSpec parses the requirements from a negated "No" string.
func (*Requirements) Add ¶
func (requirements *Requirements) Add(attribute uint8) *Requirements
Add adds an attribute.
func (*Requirements) CheckComplianceTo ¶
func (requirements *Requirements) CheckComplianceTo(requirement *Requirements) error
CheckComplianceTo checks if the requirements are compliant to the given required requirements.
func (*Requirements) Empty ¶
func (requirements *Requirements) Empty() bool
Empty returns whether the requirements are empty.
func (*Requirements) Has ¶
func (requirements *Requirements) Has(attribute uint8) bool
Has returns whether the requirements contain the given attribute.
func (*Requirements) Remove ¶
func (requirements *Requirements) Remove(attribute uint8) *Requirements
Remove removes an attribute.
func (*Requirements) SerializeToNoSpec ¶
func (requirements *Requirements) SerializeToNoSpec() string
SerializeToNoSpec returns the requirements as a negated "No" string.
func (*Requirements) ShortString ¶
func (requirements *Requirements) ShortString() string
ShortString returns a short string representation of the requirements.
func (*Requirements) String ¶
func (requirements *Requirements) String() string
String returns a string representation of the requirements.
type Seal ¶
type Seal struct { Scheme string `json:",omitempty"` // Key Establishment: Signet ID of recipient's signet // Signature: Signet ID of signer's signet ID string `json:",omitempty"` // Key Establishment: Public key or wrapped key // Signature: Signature value Value []byte `json:",omitempty"` }
Seal holds a key, key exchange or signature within a letter.
type Session ¶
type Session struct { DefaultSymmetricKeySize int SecurityLevel int // contains filtered or unexported fields }
Session holds session information for operations using the envelope it was initialized with.
func (*Session) Close ¶
Close encrypts (and possibly signs) the given data and returns a Letter. Storyline: Close takes an envelope, inserts the message and closes it, resulting in a letter.
func (*Session) Open ¶
Open decrypts (and possibly verifies) the given letter and returns the original data. Storyline: Open takes a letter, checks any seals, opens it and returns the message.
type Signet ¶
type Signet struct { Version uint8 ID string Scheme string Key []byte Public bool `json:",omitempty"` // key is the public part of a key pair Protection *Envelope `json:",omitempty"` // key is a serialized letter // Metadata about Signet Info *SignetInfo `json:",omitempty"` // Signature of Version, Scheme, Key, Public, Protected, Info Signature *Letter `json:",omitempty"` // contains filtered or unexported fields }
Signet describes a cryptographic key pair. Passwords and Keys may also be wrapped in a Signet for easier integration.
func GenerateSignet ¶
GenerateSignet returns a new signet with a freshly generated key.
func KeyFromTextFormat ¶ added in v0.3.0
KeyFromTextFormat loads a secret key from the text format.
func NewSignetBase ¶
NewSignetBase creates a new signet base without a key.
func RecipientFromTextFormat ¶ added in v0.3.0
RecipientFromTextFormat loads a recipient (public key) from the text format.
func SenderFromTextFormat ¶ added in v0.3.0
SenderFromTextFormat loads a sender (private key) from the text format.
func SignetFromBase58 ¶ added in v0.3.0
SignetFromBase58 parses and loads a base58 encoded serialized signet.
func SignetFromBytes ¶ added in v0.3.0
SignetFromBytes parses and loads a serialized signet.
func (*Signet) AsRecipient ¶
AsRecipient returns a public version of the Signet.
func (*Signet) AssignUUID ¶
AssignUUID generates a (new) UUID for the Signet.
func (*Signet) Burn ¶
Burn destroys all the key material and renders the Signet unusable. This is currently ineffective, see known issues in the project's README.
func (*Signet) GenerateKey ¶
GenerateKey generates a new key. Will not operate if key is already present.
func (*Signet) GetStoredKey ¶
GetStoredKey returns the stored key and whether it is public.
func (*Signet) PrivateKey ¶
func (signet *Signet) PrivateKey() crypto.PrivateKey
PrivateKey returns the private key or nil, if there is none.
func (*Signet) SetLoadedKeys ¶
func (signet *Signet) SetLoadedKeys(pubKey crypto.PublicKey, privKey crypto.PrivateKey)
SetLoadedKeys sets the loaded public and private keys.
func (*Signet) SetStoredKey ¶
SetStoredKey sets a new stored key and whether it is public.
func (*Signet) ToBase58 ¶ added in v0.3.0
ToBase58 serializes the signet and encodes it with base58.
type SignetInfo ¶
type SignetInfo struct { Name string Owner string Created time.Time Expires time.Time Details [][2]string }
SignetInfo holds human readable meta information about a signet.
type Suite ¶
type Suite struct { ID string Tools []string Provides *Requirements SecurityLevel int Status uint8 }
Suite describes a cipher suite - a set of algorithms and the attributes they provide.
type TrustStore ¶
type TrustStore interface { // GetSignet returns the Signet with the given ID. GetSignet(id string, recipient bool) (*Signet, error) }
TrustStore holds a set of trusted Signets and Recipients.
type WireSession ¶
type WireSession struct {
// contains filtered or unexported fields
}
WireSession holds session information specific to communication over a network connection.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package lhash provides integrated labeled hashes.
|
Package lhash provides integrated labeled hashes. |
Package supply provides a cache of signets for pre-generating signets.
|
Package supply provides a cache of signets for pre-generating signets. |
all
Package all imports all tool subpackages
|
Package all imports all tool subpackages |