• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 Google LLC
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 package com.google.crypto.tink;
18 
19 import com.google.errorprone.annotations.Immutable;
20 
21 /**
22  * Represents a cryptographic function without the actual key material.
23  *
24  * <p>In Tink, a Key represents a set of cryptographic functions. The Parameters class contains all
25  * the information about the function which is not randomly chosen with each instance.
26  */
27 @Immutable
28 public abstract class Parameters {
29   /**
30    * Returns true if a key created with the parameters in this object has to have a certain ID when
31    * it is in a keyset.
32    *
33    * <p>In Tink, certain keys change their behavior depending on the key id (for example, an {@link
34    * Aead} object can prefix the ciphertext with the big endian encoding of the key id). If this is
35    * the case, such a key should require a unique id in {@link Key#getIdRequirementOrNull} and
36    * return true here.
37    */
hasIdRequirement()38   public abstract boolean hasIdRequirement();
39 }
40