Documentation ¶
Index ¶
- type MetaData
- type Sig
- func (sig Sig) MarshalCBOR(w *cbor.CBORWriter) error
- func (sig Sig) MetaData() MetaData
- func (sig *Sig) SignData(privateKey interface{}, encoding []byte) error
- func (sig Sig) String() string
- func (sig *Sig) UnmarshalArray(in []interface{}) error
- func (sig *Sig) VerifySignature(publicKey interface{}, encoding []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaData ¶
type MetaData struct { keys.PublicKeyID //ValidSince defines the time from which on this signature is valid. ValidSince is represented as seconds since the UNIX epoch UTC. ValidSince int64 //ValidUntil defines the time after which this signature is not valid anymore. ValidUntil is represented as seconds since the UNIX epoch UTC. ValidUntil int64 }
MetaData contains meta data of the signature
type Sig ¶
type Sig struct { keys.PublicKeyID //ValidSince defines the time from which on this signature is valid. ValidSince is represented as seconds since the UNIX epoch UTC. ValidSince int64 //ValidUntil defines the time after which this signature is not valid anymore. ValidUntil is represented as seconds since the UNIX epoch UTC. ValidUntil int64 //Data holds the signature data Data interface{} // contains filtered or unexported fields }
Sig contains meta data of the signature and the signature data itself.
func (Sig) MarshalCBOR ¶
func (sig Sig) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements a CBORMarshaler.
func (*Sig) SignData ¶
SignData adds signature meta data to encoding. It then signs the encoding with privateKey and updates sig.Data field with the generated signature In case of an error an error is returned indicating the cause, otherwise nil is returned
func (*Sig) UnmarshalArray ¶
UnmarshalArray takes in a CBOR decoded aray and populates Sig.
func (*Sig) VerifySignature ¶
VerifySignature adds signature meta data to the encoding. It then signs the encoding with privateKey and compares the resulting signature with the sig.Data. Returns true if there exist signatures and they are identical