github.com/mre-fog/trillianxx@v1.1.2-0.20180615153820-ae375a99d36a/crypto/keyspb/keyspb.proto (about) 1 // Copyright 2017 Google Inc. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 option go_package = "github.com/google/trillian/crypto/keyspb"; 18 19 package keyspb; 20 21 // Specification for a private key. 22 message Specification { 23 /// ECDSA defines parameters for an ECDSA key. 24 message ECDSA { 25 // The supported elliptic curves. 26 enum Curve { 27 DEFAULT_CURVE = 0; // Curve will be chosen by Trillian. 28 P256 = 1; 29 P384 = 2; 30 P521 = 3; 31 } 32 33 // The elliptic curve to use. 34 // Optional. If not set, the default curve will be used. 35 Curve curve = 1; 36 } 37 38 // RSA defines parameters for an RSA key. 39 message RSA { 40 // Size of the keys in bits. Must be sufficiently large to allow two primes 41 // to be generated. 42 // Optional. If not set, the key size will be chosen by Trillian. 43 int32 bits = 1; 44 } 45 46 // The type of parameters provided determines the algorithm used for the key. 47 oneof params { 48 // The parameters for an ECDSA key. 49 ECDSA ecdsa_params = 1; 50 51 // The parameters for an RSA key. 52 RSA rsa_params = 2; 53 } 54 } 55 56 // PEMKeyFile identifies a private key stored in a PEM-encoded file. 57 message PEMKeyFile { 58 // File path of the private key. 59 string path = 1; 60 61 // Password for decrypting the private key. 62 // If empty, indicates that the private key is not encrypted. 63 string password = 2; 64 } 65 66 // PrivateKey is a private key, used for generating signatures. 67 message PrivateKey { 68 // The key in DER-encoded form. 69 // The specific format (e.g. PKCS8) is not specified. 70 bytes der = 1; 71 } 72 73 // PublicKey is a public key, used for verifying signatures. 74 message PublicKey { 75 // The key in DER-encoded PKIX form. 76 bytes der = 1; 77 } 78 79 // PKCS11Config identifies a private key accessed using PKCS #11. 80 message PKCS11Config { 81 // The label of the PKCS#11 token. 82 string token_label = 1; 83 // The PIN for the specific token. 84 string pin = 2; 85 // The PEM public key assosciated with the private key to be used. 86 string public_key = 3; 87 }