1// Copyright 2018 Google Inc. 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//////////////////////////////////////////////////////////////////////////////// 16 17// Definitions for RSA SSA (Signature Schemes with Appendix) using PKCS1-v1_5 18// encoding (https://tools.ietf.org/html/rfc8017#section-8.2). 19syntax = "proto3"; 20 21package google.crypto.tink; 22 23import "proto/common.proto"; 24 25option java_package = "com.google.crypto.tink.proto"; 26option java_multiple_files = true; 27option go_package = "github.com/google/tink/go/proto/rsa_ssa_pkcs1_go_proto"; 28 29message RsaSsaPkcs1Params { 30 // Hash function used in computing hash of the signing message 31 // (see https://tools.ietf.org/html/rfc8017#section-9.2). 32 // Required. 33 HashType hash_type = 1; 34} 35 36// key_type: type.googleapis.com/google.crypto.tink.RsaSsaPkcs1PublicKey 37message RsaSsaPkcs1PublicKey { 38 // Required. 39 uint32 version = 1; 40 // Required. 41 RsaSsaPkcs1Params params = 2; 42 // Modulus. 43 // Unsigned big integer in bigendian representation. 44 bytes n = 3; 45 // Public exponent. 46 // Unsigned big integer in bigendian representation. 47 bytes e = 4; 48} 49 50// key_type: type.googleapis.com/google.crypto.tink.RsaSsaPkcs1PrivateKey 51message RsaSsaPkcs1PrivateKey { 52 // Required. 53 uint32 version = 1; 54 // Required. 55 RsaSsaPkcs1PublicKey public_key = 2; 56 // Private exponent. 57 // Unsigned big integer in bigendian representation. 58 // Required. 59 bytes d = 3; 60 61 // The following parameters are used to optimize RSA signature computation. 62 // The prime factor p of n. 63 // Unsigned big integer in bigendian representation. 64 // Required. 65 bytes p = 4; 66 // The prime factor q of n. 67 // Unsigned big integer in bigendian representation. 68 // Required. 69 bytes q = 5; 70 // d mod (p - 1). 71 // Unsigned big integer in bigendian representation. 72 // Required. 73 bytes dp = 6; 74 // d mod (q - 1). 75 // Unsigned big integer in bigendian representation. 76 // Required. 77 bytes dq = 7; 78 // Chinese Remainder Theorem coefficient q^(-1) mod p. 79 // Unsigned big integer in bigendian representation. 80 // Required. 81 bytes crt = 8; 82} 83 84message RsaSsaPkcs1KeyFormat { 85 // Required. 86 RsaSsaPkcs1Params params = 1; 87 // Required. 88 uint32 modulus_size_in_bits = 2; 89 // Required. 90 bytes public_exponent = 3; 91} 92