File: psa_key_attributes.proto

package info (click to toggle)
rust-parsec-interface 0.29.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,268 kB
  • sloc: sh: 34; makefile: 4
file content (84 lines) | stat: -rw-r--r-- 2,051 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Copyright 2019 Contributors to the Parsec project.
 * SPDX-License-Identifier: Apache-2.0
 */
syntax = "proto3";

package psa_key_attributes;

import "psa_algorithm.proto";

message KeyAttributes {
  KeyType key_type = 1;
  uint32 key_bits = 2;
  KeyPolicy key_policy = 3;
}

message KeyType {
  message RawData {}
  message Hmac {}
  message Derive {}
  message Aes {}
  message Des {}
  message Camellia {}
  message Arc4 {}
  message Chacha20 {}
  message RsaPublicKey {}
  message RsaKeyPair {}
  message EccKeyPair { EccFamily curve_family = 1; }
  message EccPublicKey { EccFamily curve_family = 1; }
  message DhKeyPair { DhFamily group_family = 1; }
  message DhPublicKey { DhFamily group_family = 1; }
  enum EccFamily {
    ECC_FAMILY_NONE = 0; // This default variant should not be used.
    SECP_K1 = 1;
    SECP_R1 = 2;
    SECP_R2 = 3 [ deprecated = true ];
    SECT_K1 = 4; // DEPRECATED for sect163k1 curve
    SECT_R1 = 5; // DEPRECATED for sect163r1 curve
    SECT_R2 = 6 [ deprecated = true ];
    BRAINPOOL_P_R1 = 7; // DEPRECATED for brainpoolP160r1 curve
    FRP = 8;
    MONTGOMERY = 9;
  }
  enum DhFamily { RFC7919 = 0; }

  oneof variant {
    RawData raw_data = 1;
    // Symmetric keys
    Hmac hmac = 2;
    Derive derive = 3;
    Aes aes = 4;
    Des des = 5 [ deprecated = true ];
    Camellia camellia = 6;
    Arc4 arc4 = 7 [ deprecated = true ];
    Chacha20 chacha20 = 8;
    // RSA keys
    RsaPublicKey rsa_public_key = 9;
    RsaKeyPair rsa_key_pair = 10;
    // Elliptic Curve keys
    EccKeyPair ecc_key_pair = 11;
    EccPublicKey ecc_public_key = 12;
    // Finite Field Diffie Hellman keys
    DhKeyPair dh_key_pair = 13;
    DhPublicKey dh_public_key = 14;
  }
}

message KeyPolicy {
  UsageFlags key_usage_flags = 1;
  psa_algorithm.Algorithm key_algorithm = 2;
}

message UsageFlags {
  bool export = 1;
  bool copy = 2;
  bool cache = 3;
  bool encrypt = 4;
  bool decrypt = 5;
  bool sign_message = 6;
  bool verify_message = 7;
  bool sign_hash = 8;
  bool verify_hash = 9;
  bool derive = 10;
}