Documentation ¶
Index ¶
- Variables
- func AddProof(jsonLdObject map[string]interface{}, proof *Proof) error
- func CreateDetachedJWTHeader(p *Proof) string
- func CreateVerifyData(suite signatureSuite, jsonldDoc map[string]interface{}, proof *Proof, ...) ([]byte, error)
- func CreateVerifyHash(suite signatureSuite, jsonldDoc, proofOptions map[string]interface{}, ...) ([]byte, error)
- func GetCopyWithoutProof(jsonLdObject map[string]interface{}) map[string]interface{}
- func GetJWTSignature(jwt string) ([]byte, error)
- type Proof
- type SignatureRepresentation
Constants ¶
This section is empty.
Variables ¶
var ErrProofNotFound = errors.New("proof not found")
ErrProofNotFound is returned when proof is not found.
Functions ¶
func CreateDetachedJWTHeader ¶
CreateDetachedJWTHeader creates detached JWT header.
func CreateVerifyData ¶
func CreateVerifyData(suite signatureSuite, jsonldDoc map[string]interface{}, proof *Proof, opts ...jsonld.ProcessorOpts) ([]byte, error)
CreateVerifyData creates data that is used to generate or verify a digital signature. It depends on the signature value holder type. In case of "proofValue", the standard Create Verify Hash algorithm is used. In case of "jws", verify data is built as JSON Web Signature (JWS) with detached payload.
func CreateVerifyHash ¶
func CreateVerifyHash(suite signatureSuite, jsonldDoc, proofOptions map[string]interface{}, opts ...jsonld.ProcessorOpts) ([]byte, error)
CreateVerifyHash returns data that is used to generate or verify a digital signature Algorithm steps are described here https://w3c-dvcg.github.io/ld-signatures/#create-verify-hash-algorithm
func GetCopyWithoutProof ¶
GetCopyWithoutProof gets copy of JSON LD Object without proofs (signatures).
func GetJWTSignature ¶
GetJWTSignature returns signature part of JWT.
Types ¶
type Proof ¶
type Proof struct { Type string Created *util.TimeWithTrailingZeroMsec Creator string VerificationMethod string ProofValue []byte JWS string ProofPurpose string Domain string Nonce []byte Challenge string SignatureRepresentation SignatureRepresentation // CapabilityChain must be an array. Each element is either a string or an object. CapabilityChain []interface{} }
Proof is cryptographic proof of the integrity of the DID Document.
func (*Proof) JSONLdObject ¶
JSONLdObject returns map that represents JSON LD Object.
func (*Proof) PublicKeyID ¶
PublicKeyID provides ID of public key to be used to independently verify the proof. "verificationMethod" field is checked first. If not empty, its value is returned. Otherwise, "creator" field is returned if not empty. Otherwise, error is returned.
type SignatureRepresentation ¶
type SignatureRepresentation int
SignatureRepresentation defines a representation of signature value.
const ( // SignatureProofValue uses "proofValue" field in a Proof to put/read a digital signature. SignatureProofValue SignatureRepresentation = iota // SignatureJWS uses "jws" field in a Proof as an element for representation of detached JSON Web Signatures. SignatureJWS )