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

FieldTypeRequiredDescriptionConstraints
ktyconstyes
  • = "EC"
crvconstyes
  • = "P-256"
xstringyesThe public x coordinate, base64url, as WebCrypto exports it.
  • pattern ^[A-Za-z0-9_-]{43}$
ystringyesThe public y coordinate, base64url, as WebCrypto exports it.
  • pattern ^[A-Za-z0-9_-]{43}$
extconst
  • = true
key_opsarray of enum
  • items: one of "deriveBits", "deriveKey", "verify"

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 }] }