LockerPublicKey locker.public-key@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/locker/public-key.v1.json
locker.public-key@1: one P-256 public key as a JWK. The same shape is used for the ECDH key that receives content keys and for the ECDSA key that signs the fingerprint; what a key does is decided by where it is used, never by the key itself.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
kty | const | yes |
| |
crv | const | yes |
| |
x | string | yes | The public x coordinate, base64url, as WebCrypto exports it. |
|
y | string | yes | The public y coordinate, base64url, as WebCrypto exports it. |
|
ext | const |
| ||
key_ops | array of enum |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"kty": "EC",
"crv": "P-256",
"x": "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHg",
"y": "eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXk"
}Rejected: other-curve
{
"kty": "EC",
"crv": "P-384",
"x": "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHg",
"y": "eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXk"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('locker.public-key@1', value); // { valid, errors: [{ path, message }] }