aries_cloudagent.messaging.jsonld package

Submodules

aries_cloudagent.messaging.jsonld.create_verify_data module

Contains the functions needed to produce and verify a json-ld signature.

This file was ported from https://github.com/transmute-industries/Ed25519Signature2018/blob/master/

src/createVerifyData/index.js
aries_cloudagent.messaging.jsonld.create_verify_data.create_verify_data(data, signature_options, document_loader=None)[source]

Encapsulate process of constructing string used during sign and verify.

aries_cloudagent.messaging.jsonld.credential module

Sign and verify functions for json-ld based credentials.

aries_cloudagent.messaging.jsonld.credential.b64decode(bytes)[source]

Url Safe B64 Decode.

aries_cloudagent.messaging.jsonld.credential.b64encode(str)[source]

Url Safe B64 Encode.

aries_cloudagent.messaging.jsonld.credential.create_jws(encoded_header, verify_data)[source]

Compose JWS.

aries_cloudagent.messaging.jsonld.credential.did_key(verkey: str) → str[source]

Qualify verkey into DID key if need be.

aries_cloudagent.messaging.jsonld.credential.jws_sign(session, verify_data, verkey)[source]

Sign JWS.

aries_cloudagent.messaging.jsonld.credential.jws_verify(session, verify_data, signature, public_key)[source]

Detatched jws verify handling.

aries_cloudagent.messaging.jsonld.credential.sign_credential(session, credential, signature_options, verkey)[source]

Sign Credential.

aries_cloudagent.messaging.jsonld.credential.verify_credential(session, doc, verkey)[source]

Verify credential.

aries_cloudagent.messaging.jsonld.credential.verify_jws_header(header)[source]

Check header requirements.

aries_cloudagent.messaging.jsonld.routes module

jsonld admin routes.

class aries_cloudagent.messaging.jsonld.routes.DocSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for LD doc to sign.

credential = <fields.Dict(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid mapping type.'})>
options = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
class aries_cloudagent.messaging.jsonld.routes.SignRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for signing a jsonld doc.

doc = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
verkey = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
class aries_cloudagent.messaging.jsonld.routes.SignResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for a signed jsonld doc.

error = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
signed_doc = <fields.Dict(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid mapping type.'})>
class aries_cloudagent.messaging.jsonld.routes.SignatureOptionsSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict[KT, VT] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

Schema for LD signature options.

opts = <marshmallow.schema.SchemaOpts object>
class aries_cloudagent.messaging.jsonld.routes.SignedDocSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Verifiable doc schema.

class Meta[source]

Bases: object

Keep unknown values.

unknown = 'include'
proof = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
class aries_cloudagent.messaging.jsonld.routes.VerifyRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for signing a jsonld doc.

doc = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
verkey = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
class aries_cloudagent.messaging.jsonld.routes.VerifyResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for verification result.

error = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
valid = <fields.Boolean(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid boolean.'})>
aries_cloudagent.messaging.jsonld.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Amend swagger API.

aries_cloudagent.messaging.jsonld.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Register routes.

aries_cloudagent.messaging.jsonld.routes.sign(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Request handler for signing a jsonld doc.

Parameters:request – aiohttp request object
aries_cloudagent.messaging.jsonld.routes.verify(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Request handler for signing a jsonld doc.

Parameters:request – aiohttp request object