keyOperations property

List<String> keyOperations

The operation(s) that the key is intended to be used for.

Values defined by the specification are:

  • sign (compute digital signature or MAC)
  • verify (verify digital signature or MAC)
  • encrypt (encrypt content)
  • decrypt (decrypt content and validate decryption, if applicable)
  • wrapKey (encrypt key)
  • unwrapKey (decrypt key and validate decryption, if applicable)
  • deriveKey (derive key)
  • deriveBits (derive bits not to be used as a key)

Other values MAY be used.

Implementation

List<String> get keyOperations {
  switch (use) {
    case 'sig':
      return ['sign', 'verify'];
    case 'key':
      return ['wrapKey', 'unwrapKey'];
    case 'enc':
      return ['encrypt', 'decrypt'];
  }
  throw UnsupportedError('Algorithms for use \'$use\' not supported');
}