Utilities
Generate Sample Crypto Material
Metalo has a command that generates a new set of various data shapes used in MetaLocker, such as keys, key pairs, identities, passphrases, etc.
metalo sample-crypto
The following structures are generated:
sampleAESKeyBase64
- a Base64 encoded AES keysampleApiKeys
- a key/secret pait that can be used in MetaLocker’s configuration file,apiKeys
sectionsampleAssetID
- a new asset IDsampleEd25519Key
- an Ed25519 key pair in Base64 encodingsampleIdentity
- a sample identity with one unilockersamplePassphrase
- a sample passphrase with a double SHA256 hash. It’s useful for generating account passwords using direct calls to MetaLocker API.
Sample output:
{
"sampleAESKeyBase64": "05fwqWVI4YWujQQILZHPQWHx+C5P8jpZuGXwH/q6WT4=",
"sampleApiKeys": {
"key": "CwP1Jx1Zscw3ggPdtqAo7",
"secret": "7NJWBnibdvyoUz7bdskSz4LhWM9piNts7FFJRsxu6ay2"
},
"sampleAssetID": "did:piprate:DdbpeCpwEjvR7DkySz3ZMBP4FJPCTBjnKCFnG2KGMS7p",
"sampleEd25519Key": {
"privateKeyBase64": "qkyXe0lku8V8MCPnHLzjFiZGEGXT1+0DIZgpJwEAnGK9QT0pHKpR9y/XJYmpIDYiwYO0/3X8uuIRI58QFr2XTw==",
"publicKeyBase64": "vUE9KRyqUfcv1yWJqSA2IsGDtP91/LriESOfEBa9l08="
},
"sampleIdentity": {
"did": {
"id": "did:piprate:FWY4LonYr3Gj9ARUVHM89a",
"verKey": "8ufbXtnaWHWbTEQwC3o7BPz7HzX79aA5MC9VBAgqhXpA",
"signKey": "2Trn9sFMZ1tufKdA1csLGc67A6CJgDgk7dhfnmybAvGBa1u9XoZCuc6hWyLkF5ciUV4WcWRFyk4fPfH4dFwKmjMQ"
},
"created": "2022-11-22T00:49:12.787872Z",
"name": "Sample Identity",
"type": "Persona",
"level": 3,
"lockers": [
{
"id": "7bM9n7xTvZbKKgQctK4T7ZXaptzC6kcASBgxq2z3TSu3",
"name": "Sample Identity",
"level": 3,
"participants": [
{
"id": "did:piprate:FWY4LonYr3Gj9ARUVHM89a",
"sharedSecret": "8DAwfbChGFx1zmpLGYmIs8IOco0/agP6CA6vrEYQJSw=",
"self": true,
"rootPublicKey": "xpub661MyMwAqRbcG3ks1kfrCM7b75qWBaAKu4xgwW5qv5djBp6vBoKEAn4uaaDSBUDrabp9PAwE5nmuPaVoznGnSVnRSnKJ4NocvvosMNVRb9H",
"encryptedRootPrivateKey": "Pc0ysSI6/dhmVkj7itWlLdefS2IuK25/CBvqymLolnCQoCFjHo4OFmnfoEH1ze53/kuMWRJqXGSHV+3Tcyhh4p+KaV/ih/GRGdhU0G3r6NQxAGuZUMAfj0ry2wvhGs2eIp6vukzrZ05g9YfxJ9q2Jshn8mnqLhbJtuD1jFK6xykhDWLFGCozLMExKEyA+2RJsoNCyiT02GVpY3qKTwN+"
}
],
"created": "2022-11-22T00:49:12.802126Z",
"expires": "2032-11-22T00:49:12.787872Z",
"firstBlock": 1
}
]
},
"samplePassphrase": {
"doubleSha256": "rUDA9599HxuDWSXGrYca1XVYqu2U9vJ1ZDvkt7VCejY=",
"value": "pBkr2ArKSnQb1WHgsFXU1dVvMqKYZcd4bWGvCCKYQJf"
}
}
Generate New Asset
You may generate a new asset ID using new-asset
command
Examples
# generate new random asset ID
metalo new asset
# generate asset ID for the given file
metalo new asset <path-to-file>
Sample Output
did:piprate:C6r7hQvePwGJbPk38qkx8rN5rgQ7XTezGNqgR9jPPany