[][src]Module didkit::c

Statics

VERSION_C

The version of the DIDKit library, as a NULL-terminated string

Functions

didkit_did_auth

Issue a Verifiable Presentation for DIDAuth. Input parameters are the holder URI as a C string, and JSON C strings for the linked data proof options and the JWK for signing. On success, a newly-issued verifiable presentation is returned as a newly-allocated C string. The returned string should be freed using didkit_free_string. On failure, NULL is returned, and the error message can be retrieved using didkit_error_message.

didkit_did_resolve

Resolve a DID to a DID Document. Arguments are a C string containing the DID to resolve, and a C string containing a JSON object for resolution input metadata. The return value on success is a newly-allocated C string containing either the resolved DID document or a DID resolution result JSON object. On error, NULL is returned, and the error can be retrieved using didkit_error_message.

didkit_did_url_dereference

Resolve a DID to a DID Document. Arguments are a C string containing the DID URL to dereference, and a C string containing a JSON object for dereferencing input metadata. The return value on success is a newly-allocated C string containing either a resolved resource or a DID resolution result JSON object. On error, NULL is returned, and the error can be retrieved using didkit_error_message.

didkit_free_string

Free a C string that has been dynamically allocated by DIDKit. This should be used for strings returned from most DIDKit C functions, per their respective documentation.

didkit_get_version

Get the version of the DIDKit library. Returns a static C string which should not be mutated or freed.

didkit_key_to_did

Convert a key in JWK format to a did:key DID. Input should be a JWK containing public key parameters. Private key parameters in the JWK are ignored. On success, returns a newly-allocated C string containing a DID corresponding to the JWK. The returned string must be freed with didkit_free_string. On failure, returns NULL; the error message can be retrieved with didkit_error_message.

didkit_key_to_verification_method

Convert a key to a did:key DID URI for use in the verificationMethod property of a linked data proof. Input should be a C string containing the key as a JWK. The JWK should contain public key material; private key parameters are ignored. On success, this function returns a newly-allocated C string containing the verificationMethod URI. On failure, NULL is returned; the error message can be retrieved using didkit_error_message.

didkit_vc_generate_ed25519_key

Generate a new Ed25519 keypair in JWK format. On success, returns a pointer to a newly-allocated string containing the JWK. The string must be freed with didkit_free_string. On failure, returns NULL; the error message can be retrieved with didkit_error_message.

didkit_vc_issue_credential

Issue a Verifiable Credential. Input parameters are JSON C strings for the unsigned credential to be issued, the linked data proof options, and the JWK for signing. On success, the newly-issued verifiable credential is returned as a newly-allocated C string. The returned string should be freed using didkit_free_string. On failure, NULL is returned, and the error message can be retrieved using didkit_error_message.

didkit_vc_issue_presentation

Issue a Verifiable Presentation. Input parameters are JSON C strings for the unsigned presentation to be issued, the linked data proof options, and the JWK for signing. On success, the newly-issued verifiable presentation is returned as a newly-allocated C string. The returned string should be freed using didkit_free_string. On failure, NULL is returned, and the error message can be retrieved using didkit_error_message.

didkit_vc_verify_credential

Verify a Verifiable Credential. Arguments are a C string containing the Verifiable Credential to verify, and a C string containing a JSON object for the linked data proof options for verification. The return value is a newly-allocated C string containing a JSON object for the verification result, or NULL in case of certain errors. On successful verification, the verification result JSON object contains a "errors" property whose value is an empty array. If verification fails, either NULL is returned and the error can be retrieved using didkit_error_message, or a verification result JSON object is returned with an "errors" array containing information about the verification error(s) encountered. A string returned from this function should be freed using didkit_free_string.

didkit_vc_verify_presentation

Verify a Verifiable Presentation. Arguments are a C string containing the Verifiable Presentation to verify, and a C string containing a JSON object for the linked data proof options for verification. The return value is a newly-allocated C string containing a JSON object for the verification result, or NULL in case of certain errors. On successful verification, the verification result JSON object contains a "errors" property whose value is an empty array. If verification fails, either NULL is returned and the error can be retrieved using didkit_error_message, or a verification result JSON object is returned with an "errors" array containing information about the verification error(s) encountered. A string returned from this function should be freed using didkit_free_string.