Documentation ¶
Overview ¶
Package signature implements the CACAO 2.0 signature object.
Index ¶
- func GetSigningMethodsVocab() []string
- type Signature
- func (s *Signature) Encode() ([]byte, error)
- func (s *Signature) EncodeToString() (string, error)
- func (s *Signature) GetCurrentTime(precision string) string
- func (s *Signature) SetCreated(t interface{}) error
- func (s *Signature) SetModified(t interface{}) error
- func (s *Signature) SetNewID(objType string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSigningMethodsVocab ¶
func GetSigningMethodsVocab() []string
GetSigningMethodsVocab - This will return a slice of officially supported signing methods
Types ¶
type Signature ¶
type Signature struct { ObjectType string `json:"type,omitempty"` ID string `json:"id,omitempty"` CreatedBy string `json:"created_by,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` Revoked bool `json:"revoked,omitempty"` Signee string `json:"signee,omitempty"` ValidFrom string `json:"valid_from,omitempty"` ValidUntil string `json:"valid_until,omitempty"` RelatedTo string `json:"related_to,omitempty"` RelatedVersion string `json:"related_version,omitempty"` HashAlgorithm string `json:"hash_algorithm,omitempty"` Algorithm string `json:"algorithm,omitempty"` PublicKey string `json:"public_key,omitempty"` PublicCertChain []string `json:"public_cert_chain,omitempty"` CertURL string `json:"cert_url,omitempty"` Thumbprint string `json:"thumbprint,omitempty"` Value string `json:"value,omitempty"` Signature *Signature `json:"signature,omitempty"` }
Signature - This type defines the digital signature for a playbook object
func New ¶
func New() *Signature
New - This function will create a new signature object and return it as a pointer. It will also initialize the object by setting all of the basic properties.
func (*Signature) Encode ¶
Encode - This method is a simple wrapper for encoding an object into JSON
func (*Signature) EncodeToString ¶
EncodeToString - This method is a simple wrapper for encoding an object into JSON
func (*Signature) GetCurrentTime ¶
GetCurrentTime - This method takes in a value of either milli or micro and returns the current time in RFC 3339 format
func (*Signature) SetCreated ¶
SetCreated - This method takes in a timestamp in either time.Time or string format and updates the created property with it. The value is stored as a string, so if the value is in time.Time format, it will be converted to the correct timestamp format.
func (*Signature) SetModified ¶
SetModified - This method takes in a timestamp in either time.Time or string format and updates the modified property with it. The value is stored as a string, so if the value is in time.Time format, it will be converted to the correct timestamp format.