Documentation
¶
Index ¶
- func TimeIn(t time.Time, zone string) time.Time
- type Asset
- type Constraint
- type ContractBody
- type ContractDescription
- type ContractString
- type Event
- type Identity
- type Link
- type Object
- type Scope
- type Seal
- type Signature
- func (s Signature) ComputeOID(timestamp time.Time, signee string) string
- func (s *Signature) FormatTimestamps()
- func (s Signature) GetOID() string
- func (s Signature) Hash() ([]byte, error)
- func (s Signature) PartialString(index int) string
- func (s Signature) PreSignatureHash() ([]byte, error)
- func (s *Signature) SetOID(oid string)
- func (s Signature) String() string
- func (s Signature) ToASN1() ([]byte, error)
- type SignatureHeader
- type Subject
- type Tag
- type TokenClaims
- type Validity
- type Variable
- type Verb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Constraint ¶
type ContractBody ¶
type ContractBody struct {
OID string `json:"id,omitempty" bson:"id"`
Tag []Tag `json:"tag" bson:"tag"`
Contract []ContractDescription `json:"contract" bson"contract"`
Var []Variable `json:"var" bson:"var"`
Subject []Subject `json:"subject" bson:"subject"`
Verb []Verb `json:"verb" bson:"verb"`
Object []Object `json:"object" bson:"object"`
Scope []Scope `json:"scope" bson:"scope"`
Validity Validity `json:"validity" bson:"validity"`
}
ContractBody is the structure of the contracts used by the Custodian
func (ContractBody) GetOID ¶
func (b ContractBody) GetOID() string
func (ContractBody) Hash ¶
func (b ContractBody) Hash() []byte
func (*ContractBody) SetOID ¶
func (b *ContractBody) SetOID(oid string)
func (ContractBody) String ¶
func (b ContractBody) String() string
type ContractDescription ¶
type ContractDescription struct {
Language string `json:"lang" bson:"lang"`
Title string `json:"title" bson:"title"`
Description string `json:"description" bson:"description"` // Human readable
Check string `json:"check" bson:"check"`
Action []string `json:"action" bson:"action"`
}
func (ContractDescription) String ¶
func (c ContractDescription) String() string
type ContractString ¶
type ContractString struct {
OID string `json:"id" bson:"id" asn1:"printable"`
Contract string `json:"contract" bson:"contract" asn1:"printable"`
}
ContractString is used to store a contract as a string in the database
func (ContractString) GetOID ¶
func (c ContractString) GetOID() string
func (ContractString) Hash ¶
func (c ContractString) Hash() []byte
func (*ContractString) SetOID ¶
func (c *ContractString) SetOID(oid string)
func (ContractString) String ¶
func (c ContractString) String() string
type Identity ¶
type Identity struct {
ID string `json:"id"`
PublicKey *ecdsa.PublicKey `json:"publicKey"`
PrivateKey *ecdsa.PrivateKey
}
type Link ¶
type Link struct {
ID string `json:"id" bson:"id" asn1:"printable"` // FIXME: OID?
DigestMethod string `json:"digestMethod" bson:"digestMethod" asn1:"printable"`
Digest string `json:"digest" bson:"digest" asn1:"printable"`
}
Link is used to make a reference to a contract or signature.
The digest attribute contains a base4 hash of the contract/signature the link points to.
type Object ¶
type Scope ¶
type Seal ¶
type Seal struct {
Signee string `json:"signee" bson:"signee" asn1:"printable"`
Timestamp time.Time `json:"timestamp" bson:"timestamp" asn1:"generalized"`
Source string `json:"source" bson:"source" asn1:"source"`
SignatureMethod string `json:"signatureMethod" bson:"signatureMethod" asn1:"printable"`
Signature string `json:"signature" bson:"signature" asn1:"printable,optional"`
}
Seal is the structure used to store the users digital signatures and their information
type Signature ¶
type Signature struct {
OID string `json:"id" bson:"id" asn1:"printable"`
Header SignatureHeader `json:"header" bson:"header"`
Seal []Seal `json:"seal" bson:"seal"`
}
Signature is the structure of the contract signature used by the Custodian.
When a contract requires multiple signatures, the latter are chained using reference links in their header.
func (Signature) ComputeOID ¶
func (*Signature) FormatTimestamps ¶
func (s *Signature) FormatTimestamps()
FormatTimestamps converts the seals timestamps to UTC
func (Signature) PartialString ¶
func (Signature) PreSignatureHash ¶
PreSignatureHash returns the hash of the signature before we added the last seal's signature attribute
type SignatureHeader ¶
type SignatureHeader struct {
Body Link `json:"body" bson:"body" asn1:"omitempty"`
Prev Link `json:"prev" bson:"prev" asn1:"omitempty,optional"`
}
SignatureHeader represents the header of the signatures
The header contains a link to the contract body it makes reference to, as well as a link to the previous signature in the chain. If the signature is the first of the chain, the Prev field is empty.
func (SignatureHeader) String ¶
func (h SignatureHeader) String() string
type Subject ¶
type TokenClaims ¶
type TokenClaims struct {
UserID string `json:"userid"`
ClientID string `json:"clientid"`
SignatureID string `json:"signatureid"`
Actor string `json:"actor"`
Scope []string `json:"scope"`
Constraints []Constraint `json:"constraints"`
jwt.StandardClaims
}