Documentation ¶
Index ¶
- Constants
- Variables
- func AddProof(jsonLdObject map[string]interface{}, proof *Proof) error
- func CreateDetachedJWTHeader(alg string) 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 DecodeProofValue(s, proofType string) ([]byte, error)
- func EncodeProofValue(proofValue []byte, proofType string) string
- func GetCopyWithoutProof(jsonLdObject map[string]interface{}) map[string]interface{}
- func GetJWTSignature(jwt string) ([]byte, error)
- type Proof
- type SignatureRepresentation
Constants ¶
const ( // SignatureProofValue uses "proofValue" field in a Proof to put/read a digital signature. SignatureProofValue = ldproof.SignatureProofValue // SignatureJWS uses "jws" field in a Proof as an element for representation of detached JSON Web Signatures. SignatureJWS = ldproof.SignatureJWS )
Variables ¶
var ErrProofNotFound = ldproof.ErrProofNotFound
ErrProofNotFound is returned when proof is not found.
Functions ¶
func CreateDetachedJWTHeader ¶ added in v0.1.2
CreateDetachedJWTHeader creates detached JWT header.
func CreateVerifyData ¶ added in v0.1.2
func CreateVerifyData(suite signatureSuite, jsonldDoc map[string]interface{}, proof *Proof, opts ...processor.Opts) ([]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 ...processor.Opts) ([]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 DecodeProofValue ¶ added in v0.1.9
DecodeProofValue decodes proofValue basing on proof type.
func EncodeProofValue ¶ added in v0.1.9
EncodeProofValue decodes proofValue basing on proof type.
func GetCopyWithoutProof ¶
GetCopyWithoutProof gets copy of JSON LD Object without proofs (signatures).
func GetJWTSignature ¶ added in v0.1.2
GetJWTSignature returns signature part of JWT.
Types ¶
type Proof ¶
Proof is cryptographic proof of the integrity of the DID Document.
type SignatureRepresentation ¶ added in v0.1.2
type SignatureRepresentation = ldproof.SignatureRepresentation
SignatureRepresentation defines a representation of signature value.