-
Notifications
You must be signed in to change notification settings - Fork 8
Credentials examples
Daniel Luque Quintana edited this page May 23, 2020
·
1 revision
Output
------ Preparing Subject1 identity ------
------ Creating credential ------
The credential1 is: { header:
{ typ: 'JWT',
alg: 'ES256K',
kid: 'did:ala:quor:redt:QmeeasCZ9jLbXueBJ7d7csxhb#keys-1' },
payload:
{ jti: 'https://www.empresa.com/alastria/credentials/3734',
iss: 'did:ala:quor:redT:05c5e87b79022b0b85280efb332f7506d9294fe0',
sub: 'did:alastria:quorum:redt:QmeeasCZ9jLbXueBJ7d7csxhb',
iat: 1589913750,
exp: 1563783392,
nbf: 1563782792,
vc:
{ '@context': 'https://w3id.org/did/v1',
type: [Array],
credentialSubject: [Object] } } }
The signed token is: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6YWxhOnF1b3I6cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiI2tleXMtMSJ9.eyJqdGkiOiJodHRwczovL3d3dy5lbXByZXNhLmNvbS9hbGFzdHJpYS9jcmVkZW50aWFscy8zNzM0IiwiaXNzIjoiZGlkOmFsYTpxdW9yOnJlZFQ6MDVjNWU4N2I3OTAyMmIwYjg1MjgwZWZiMzMyZjc1MDZkOTI5NGZlMCIsInN1YiI6ImRpZDphbGFzdHJpYTpxdW9ydW06cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiIiwiaWF0IjoxNTg5OTEzNzUwLCJleHAiOjE1NjM3ODMzOTIsIm5iZiI6MTU2Mzc4Mjc5MiwidmMiOnsiQGNvbnRleHQiOiJodHRwczovL3czaWQub3JnL2RpZC92MSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJBbGFzdHJpYUV4YW1wbGVDcmVkZW50aWFsIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7IlN0dWRlbnRJRCI6IjExMjM1ODEzIiwibGV2ZWxPZkFzc3VyYW5jZSI6ImJhc2ljIn19fQ.Eg9gma-GgY656okYOa2ozLfOFsDdhOMzsoD0zkjQNXXj8lnZh6V36P3VlEjn1pdIDBoaHj0rydp0S-9hyZksuw
The Subject1 PSMHash is 0xbea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc4
(addSubjectCredential)The transaction is: { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
data:
'0x597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000084e04ce02cbea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc40000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000e7777772e676f6f676c652e636f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
gasLimit: 600000,
gasPrice: 0,
nonce: '0x0' }
(addSubjectCredential)The transaction bytes data is: 0xf9018882045580830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b90124597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000084e04ce02cbea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc40000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000e7777772e676f6f676c652e636f6d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca005dcfab16b2c886252c794ff684b69ee559b57878ed0f5db274f2028a2cd3c67a003d026d33fcf86a2dfcb011065a85849545b7fcbd281b5b32c0d38236cd98fde
HASH: 0xdba9319c1db258836b26c2ea043f56184156037677a7f689f5e7b1c80350a1cd
RECEIPT: { blockHash:
'0xd34e04483b2a78d6e08a258245bfa30b3e93b4312a540cbca2b52b4dec933089',
blockNumber: 40131373,
contractAddress: null,
cumulativeGasUsed: 124843,
from: '0x806bc0d7a47b890383a831634bcb92dd4030b092',
gasUsed: 124843,
logs:
[ { address: '0x9d68DB2F1E7Bf4c65DBD31F6CC9F2adeb86D584d',
topics: [Array],
data:
'0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000084e04ce02cbea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc40000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000e7777772e676f6f676c652e636f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
blockNumber: 40131373,
transactionHash:
'0xdba9319c1db258836b26c2ea043f56184156037677a7f689f5e7b1c80350a1cd',
transactionIndex: 0,
blockHash:
'0xd34e04483b2a78d6e08a258245bfa30b3e93b4312a540cbca2b52b4dec933089',
logIndex: 0,
removed: false,
id: 'log_85d0a7ba' } ],
logsBloom:
'0x00000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000080000000010000000000000000002000000000000000000000000000000000000200000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000010000000000000000000000',
status: true,
to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
transactionHash:
'0xdba9319c1db258836b26c2ea043f56184156037677a7f689f5e7b1c80350a1cd',
transactionIndex: 0 }
(SubjectCredentialStatus) -----> { exists: true, status: '0' }
Output
------ Getting Credential List os Subject1 ------
(credentialList) Transaction ------> { to: '0x7bbca11cbd86b562136d5708eba40f4bc0aa1ddc',
data:
'0x4510b1cb0000000000000000000000009d68db2f1e7bf4c65dbd31f6cc9f2adeb86d584d',
gasLimit: 600000,
gasPrice: 0,
nonce: '0x0' }
(subjectCredentialList) Transaction -------> 0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001bea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc4
(subjectCredentialList) TransactionList: { uint: '1',
'bytes32[]':
[ '0xbea00c8c86bad7dda0f6dad2ca0e48d3b522a6b33de9811d816e70a21d577fc4' ] }
Output
------ Preparing Entity1 identity ------
------ Creating credential ------
The credential1 is: { header:
{ typ: 'JWT',
alg: 'ES256K',
kid: 'did:ala:quor:redt:QmeeasCZ9jLbXueBJ7d7csxhb#keys-1' },
payload:
{ jti: 'https://www.empresa.com/alastria/credentials/3734',
iss: 'did:ala:quor:redT:05c5e87b79022b0b85280efb332f7506d9294fe0',
sub: 'did:alastria:quorum:redt:QmeeasCZ9jLbXueBJ7d7csxhb',
iat: 1589913795,
exp: 1563783392,
nbf: 1563782792,
vc:
{ '@context': 'https://w3id.org/did/v1',
type: [Array],
credentialSubject: [Object] } } }
The signed token is: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6YWxhOnF1b3I6cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiI2tleXMtMSJ9.eyJqdGkiOiJodHRwczovL3d3dy5lbXByZXNhLmNvbS9hbGFzdHJpYS9jcmVkZW50aWFscy8zNzM0IiwiaXNzIjoiZGlkOmFsYTpxdW9yOnJlZFQ6MDVjNWU4N2I3OTAyMmIwYjg1MjgwZWZiMzMyZjc1MDZkOTI5NGZlMCIsInN1YiI6ImRpZDphbGFzdHJpYTpxdW9ydW06cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiIiwiaWF0IjoxNTg5OTEzNzk1LCJleHAiOjE1NjM3ODMzOTIsIm5iZiI6MTU2Mzc4Mjc5MiwidmMiOnsiQGNvbnRleHQiOiJodHRwczovL3czaWQub3JnL2RpZC92MSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJBbGFzdHJpYUV4YW1wbGVDcmVkZW50aWFsIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7IlN0dWRlbnRJRCI6IjExMjM1ODEzIiwibGV2ZWxPZkFzc3VyYW5jZSI6ImJhc2ljIn19fQ.RDFFcnFDleQ7TYeyVtgneo8yalBW97t0KKTF7eP0asIctiG6agwBcPLT1pkkhX8B9OeoYozM2P2k64rQW2w8sQ
The Entity1 PSMHash is: 0x733e2234a217720c59347b151555833273aa8567a989b6b591e427c6a4d924c0
(addIssuerCredential)The transaction is: { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
data:
'0x597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024dc11e39b733e2234a217720c59347b151555833273aa8567a989b6b591e427c6a4d924c000000000000000000000000000000000000000000000000000000000',
gasLimit: 600000,
gasPrice: 0,
nonce: '0x0' }
(addIssuerCredential)The transaction bytes data is: 0xf90127820a7b80830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b8c4597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024dc11e39b733e2234a217720c59347b151555833273aa8567a989b6b591e427c6a4d924c0000000000000000000000000000000000000000000000000000000001ba0461006e0e83d9516506f7e3476a2cafbf1046cf70408d6bbb350b17dff7f7d8ea045036df91e448ebdc7ba411adb9af1714edf2fe067751b032b1ec4ad519a65e8
HASH: 0x1192589ddc9f40f15dcf6ab9863fbbcc58eb11be3f8678761a23fa3e54d5eb9f
RECEIPT: { blockHash:
'0x76451d1753b91eacbe6218966f723c6900d10b335209caefebbcb24495ada684',
blockNumber: 40131394,
contractAddress: null,
cumulativeGasUsed: 101164,
from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
gasUsed: 101164,
logs:
[ { address: '0x832610fDb19A2fB548D6ee54732D67F305B53890',
topics: [Array],
data:
'0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024dc11e39b733e2234a217720c59347b151555833273aa8567a989b6b591e427c6a4d924c000000000000000000000000000000000000000000000000000000000',
blockNumber: 40131394,
transactionHash:
'0x1192589ddc9f40f15dcf6ab9863fbbcc58eb11be3f8678761a23fa3e54d5eb9f',
transactionIndex: 0,
blockHash:
'0x76451d1753b91eacbe6218966f723c6900d10b335209caefebbcb24495ada684',
logIndex: 0,
removed: false,
id: 'log_13775100' } ],
logsBloom:
'0x00000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000080000000000000000000000000000000000000000000000000000000000000000200000000000000002000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000010000000400000000000000',
status: true,
to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
transactionHash:
'0x1192589ddc9f40f15dcf6ab9863fbbcc58eb11be3f8678761a23fa3e54d5eb9f',
transactionIndex: 0 }
(IssuerCredentialStatus) -----> { exists: false, status: '0' }
Output
------ Preparing Entity1 identity ------
------ Creating credential ------
The credential1 is: { header:
{ typ: 'JWT',
alg: 'ES256K',
kid: 'did:ala:quor:redt:QmeeasCZ9jLbXueBJ7d7csxhb#keys-1' },
payload:
{ jti: 'https://www.empresa.com/alastria/credentials/3734',
iss: 'did:ala:quor:redT:d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
sub: 'did:alastria:quorum:redt:QmeeasCZ9jLbXueBJ7d7csxhb',
iat: 1589920102,
exp: 1563783392,
nbf: 1563782792,
vc:
{ '@context': 'https://w3id.org/did/v1',
type: [Array],
credentialSubject: [Object] } } }
The signed token is: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6YWxhOnF1b3I6cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiI2tleXMtMSJ9.eyJqdGkiOiJodHRwczovL3d3dy5lbXByZXNhLmNvbS9hbGFzdHJpYS9jcmVkZW50aWFscy8zNzM0IiwiaXNzIjoiZGlkOmFsYTpxdW9yOnJlZFQ6ZDJjYjI0YjA2MTM5YzkxZWY2YjMyNGE0OWVmODQ0YmJlNmNjZWM5NyIsInN1YiI6ImRpZDphbGFzdHJpYTpxdW9ydW06cmVkdDpRbWVlYXNDWjlqTGJYdWVCSjdkN2NzeGhiIiwiaWF0IjoxNTg5OTIwMTAyLCJleHAiOjE1NjM3ODMzOTIsIm5iZiI6MTU2Mzc4Mjc5MiwidmMiOnsiQGNvbnRleHQiOiJodHRwczovL3czaWQub3JnL2RpZC92MSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJBbGFzdHJpYUV4YW1wbGVDcmVkZW50aWFsIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7IlN0dWRlbnRJRCI6IjExMjM1ODEzIiwibGV2ZWxPZkFzc3VyYW5jZSI6ImJhc2ljIn19fQ.Ct4M0CTLwqKCUIs2J1HeO889vOP4tTlD0uohwCE6xCAO_Wj7mE6Lce4RE1J2SlAS0zwTwEFM8J2GDNUP2UlOGw
The Entity1 PSMHash is: 0x08c270fae95219ed7d22ffb9b78c52f362825bd993ee07d68ab219e7c5666fb5
(addIssuerCredential)The transaction is: { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
data:
'0x597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024dc11e39b08c270fae95219ed7d22ffb9b78c52f362825bd993ee07d68ab219e7c5666fb500000000000000000000000000000000000000000000000000000000',
gasLimit: 600000,
gasPrice: 0,
nonce: '0x0' }
(addIssuerCredential)The transaction bytes data is: 0xf90127820a8680830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b8c4597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024dc11e39b08c270fae95219ed7d22ffb9b78c52f362825bd993ee07d68ab219e7c5666fb5000000000000000000000000000000000000000000000000000000001ca0ff6e39a8394011981802402c64cdf51b4434b001b1385da16b6ca3692f17413da02d235d5d7f97fb0789daf60c8f3047a2c75db260fcd89027a0cc4efe5d7165be
HASH: 0xc170b3d65aca7db42266dafae7dee0d3f427fc027552fbaca407097bda4be0d2
RECEIPT: { blockHash:
'0x3d3929b2f152bc0c6d62d8edc01bf84a7dc1c321c3c64d9b4c696076cb628698',
blockNumber: 40134096,
contractAddress: null,
cumulativeGasUsed: 101164,
from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
gasUsed: 101164,
logs:
[ { address: '0xd2CB24B06139c91Ef6b324a49Ef844bbe6Ccec97',
topics: [Array],
data:
'0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024dc11e39b08c270fae95219ed7d22ffb9b78c52f362825bd993ee07d68ab219e7c5666fb500000000000000000000000000000000000000000000000000000000',
blockNumber: 40134096,
transactionHash:
'0xc170b3d65aca7db42266dafae7dee0d3f427fc027552fbaca407097bda4be0d2',
transactionIndex: 0,
blockHash:
'0x3d3929b2f152bc0c6d62d8edc01bf84a7dc1c321c3c64d9b4c696076cb628698',
logIndex: 0,
removed: false,
id: 'log_94ae24b5' } ],
logsBloom:
'0x00000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000004000000000000200000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000000000000000000000000000000000010000000000000000000000',
status: true,
to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
transactionHash:
'0xc170b3d65aca7db42266dafae7dee0d3f427fc027552fbaca407097bda4be0d2',
transactionIndex: 0 }
(IssuerCredentialStatus) -----> { exists: true, status: '0' }
Output
(updateCredentialStatus)The transaction bytes data is: 0xf90147820a7c80830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b8e4597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044dd517e10733e2234a217720c59347b151555833273aa8567a989b6b591e427c6a4d924c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001ba0af815b5b1d3b5f1b352f061e9d4f692131559d12a3c2ed68fc3a97bd20943545a00ade6cce1a38ef9ecb286bfae385600bdb2305a2d7d53cadded4bbb93cdaa026
(IssuerCredentialStatus) -----> { exists: false, status: '0' }
Output
(updateCredentialStatus)The transaction bytes data is: 0xf90147820a8580830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b8e4597b2e9b0000000000000000000000007bbca11cbd86b562136d5708eba40f4bc0aa1ddc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044dd517e10dfe1132b15626411e9800368f4214a095bc66180fe3401bdd0c1ebf5f77361190000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001ca095b729ccac1f7252c5f59e33322b004cc3eb5a7af6bd871b53f7805bea3fe1c9a009fde710774a1b28ea925cd2ed71e8e7d50feb3b7d4d8a3f9818f36f6b01d974
(IssuerCredentialStatus) -----> { exists: true, status: '2' }