Versions in this module Expand all Collapse all v0 v0.4.0 Nov 14, 2019 Changes in this version + const ErrAuthoritativeButNotCore + const ErrDecodeProtectedFailed + const ErrDuplicateAttributes + const ErrDuplicatePOPSignature + const ErrDuplicateVoteSignature + const ErrImmutableBaseVersion + const ErrImmutableISD + const ErrImmutableTrustResetAllowed + const ErrInvalidAttribute + const ErrInvalidAttributesSize + const ErrInvalidCrit + const ErrInvalidKeyMeta + const ErrInvalidKeyType + const ErrInvalidKeyVersion + const ErrInvalidPrimaryAS + const ErrInvalidProtected + const ErrInvalidSignatureType + const ErrInvalidValidityPeriod + const ErrInvalidVersionIncrement + const ErrInvalidVote + const ErrInvariantViolation + const ErrMissingKey + const ErrMissingPOPSignature + const ErrMissingProofOfPossession + const ErrMissingVote + const ErrMissingVoteSignature + const ErrNotInsidePreviousValidityPeriod + const ErrPOPVerification + const ErrQuorumUnmet + const ErrSanityCheck + const ErrUnexpectedKey + const ErrUnexpectedPOPSignature + const ErrUnexpectedProofOfPossession + const ErrUnexpectedVoteSignature + const ErrUnsupportedFormat + const ErrVoteVerification + const ErrVotingQuorumTooLarge + const ErrWrongVotingKeyType + const ErrWrongVotingKeyVersion + const IssuingKeyJSON + const OfflineKeyJSON + const OnlineKeyJSON + var ErrASNotSet = errors.New("as not set") + var ErrAlgorithmNotSet = errors.New("algorithm not set") + var ErrAttributesNotSet = errors.New("attributes not set") + var ErrBaseNotUpdate = errors.New("base TRC, not update") + var ErrBaseVersionNotSet = errors.New("base_version not set") + var ErrBaseWithNonZeroGracePeriod = errors.New("trust reset with non-zero grace period") + var ErrBaseWithVotes = errors.New("base TRC with votes") + var ErrCritNotSet = errors.New("crit not set") + var ErrDescriptionNotSet = errors.New("description not set") + var ErrFormatVersionNotSet = errors.New("format_version not set") + var ErrGracePeriodNotSet = errors.New("grace_period not set") + var ErrISDNotSet = errors.New("isd not set") + var ErrKeyTypeNotSet = errors.New("key_type not set") + var ErrKeyVersionNotSet = errors.New("key_version not set") + var ErrKeysNotSet = errors.New("keys not set") + var ErrNoIssuingAS = errors.New("missing issuing AS") + var ErrNoVotingRight = errors.New("AS has no voting rights") + var ErrNotUTF8 = errors.New("not utf-8 encoded") + var ErrPrimaryASesNotSet = errors.New("primary_ases not set") + var ErrProofOfPossessionNotSet = errors.New("proof_of_possession not set") + var ErrSignatureTypeNotSet = errors.New("signature type not set") + var ErrTrustResetAllowedNotSet = errors.New("trust_reset_allowed not set") + var ErrUnexpectedVote = errors.New("unexpected vote") + var ErrUpdateWithZeroGracePeriod = errors.New("update with zero grace period") + var ErrValidityNotSet = errors.New("validity not set") + var ErrVersionNotSet = errors.New("version not set") + var ErrVotesNotSet = errors.New("votes not set") + var ErrVotingQuorumNotSet = errors.New("voting_quorum not set") + var ErrZeroVotingQuorum = errors.New("voting quorum of zero") + func EncodeSigned(signed Signed) ([]byte, error) + func SigInput(protected EncodedProtected, trc Encoded) common.RawBytes + func ValidateKeyUpdate(prev, next scrypto.KeyMeta) (bool, error) + type ASToKeyMeta map[addr.AS]scrypto.KeyMeta + type Attribute string + const Authoritative + const Core + const Issuing + const Voting + func (t *Attribute) UnmarshalText(b []byte) error + type AttributeChange int + const AttributeAdded + const AttributeRemoved + type AttributeChanges map[addr.AS]map[Attribute]AttributeChange + func (c AttributeChanges) Sensitive() bool + type Attributes []Attribute + func (t *Attributes) UnmarshalJSON(b []byte) error + func (t *Attributes) Validate() error + func (t Attributes) Contains(attr Attribute) bool + func (t Attributes) MarshalJSON() ([]byte, error) + type Crit struct + func (Crit) MarshalJSON() ([]byte, error) + func (c Crit) UnmarshalJSON(b []byte) error + type DecodedSignature struct + EncodedProtected EncodedProtected + Protected Protected + Signature []byte + type Encoded []byte + func Encode(trc *TRC) (Encoded, error) + func (p Encoded) Decode() (*TRC, error) + type EncodedProtected []byte + func EncodeProtected(p Protected) (EncodedProtected, error) + func (h EncodedProtected) Decode() (Protected, error) + type FormatVersion uint8 + func (v *FormatVersion) UnmarshalJSON(b []byte) error + type KeyChanges struct + Fresh map[KeyType]ASToKeyMeta + Modified map[KeyType]ASToKeyMeta + func (c *KeyChanges) Sensitive() bool + type KeyType int + const IssuingKey + const OfflineKey + const OnlineKey + func (t *KeyType) UnmarshalText(b []byte) error + func (t KeyType) MarshalText() ([]byte, error) + func (t KeyType) String() string + type POPVerifier struct + Encoded Encoded + Signatures []Signature + TRC *TRC + func (v POPVerifier) Verify() error + type POPs map[addr.AS]map[KeyType]DecodedSignature + type Period struct + func (t *Period) UnmarshalJSON(b []byte) error + func (t Period) MarshalJSON() ([]byte, error) + type PrimaryAS struct + Attributes Attributes + Keys map[KeyType]scrypto.KeyMeta + func (p *PrimaryAS) Is(attr Attribute) bool + func (p *PrimaryAS) UnmarshalJSON(b []byte) error + func (p *PrimaryAS) ValidateInvariant() error + type PrimaryASes map[addr.AS]PrimaryAS + func (p *PrimaryASes) Count(attribute Attribute) int + func (p *PrimaryASes) ValidateInvariant() error + func (p *PrimaryASes) WithAttribute(attribute Attribute) PrimaryASes + type Protected struct + AS addr.AS + Algorithm string + Crit Crit + KeyType KeyType + KeyVersion scrypto.KeyVersion + Type SignatureType + func (p *Protected) UnmarshalJSON(b []byte) error + type Signature struct + EncodedProtected EncodedProtected + Signature []byte + type SignatureType string + const POPSignature + const VoteSignature + func (t *SignatureType) UnmarshalText(b []byte) error + type Signed struct + EncodedTRC Encoded + Signatures []Signature + func ParseSigned(raw []byte) (Signed, error) + type TRC struct + BaseVersion scrypto.Version + Description string + FormatVersion FormatVersion + GracePeriod *Period + ISD addr.ISD + PrimaryASes PrimaryASes + ProofOfPossession map[addr.AS][]KeyType + TrustResetAllowedPtr *bool + Validity *scrypto.Validity + Version scrypto.Version + Votes map[addr.AS]Vote + VotingQuorumPtr *uint8 + func (t *TRC) Base() bool + func (t *TRC) TrustResetAllowed() bool + func (t *TRC) UnmarshalJSON(b []byte) error + func (t *TRC) ValidateInvariant() error + func (t *TRC) VotingQuorum() int + type UpdateInfo struct + AttributeChanges AttributeChanges + KeyChanges *KeyChanges + Type UpdateType + type UpdateType string + const RegularUpdate + const SensitiveUpdate + type UpdateValidator struct + Next *TRC + Prev *TRC + func (v *UpdateValidator) UpdateInfo() (UpdateInfo, error) + func (v *UpdateValidator) Validate() (UpdateInfo, error) + type UpdateVerifier struct + Next *TRC + NextEncoded Encoded + Prev *TRC + Signatures []Signature + func (v UpdateVerifier) Verify() error + type Vote struct + KeyType KeyType + KeyVersion scrypto.KeyVersion + func (v *Vote) UnmarshalJSON(b []byte) error + type Votes map[addr.AS]DecodedSignature