1 // Copyright 2023 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.keyderivation; 18 19 import com.google.crypto.tink.Parameters; 20 21 /** The public part of a {@link KeyDerivationKey}. */ 22 public abstract class KeyDerivationParameters extends Parameters { getDerivedKeyParameters()23 public abstract Parameters getDerivedKeyParameters(); 24 25 /** 26 * Whether this key needs a specific ID when it is in a Keyset. 27 * 28 * <p>Tink Keyset derivation always copies the ID of a key to the derived key. Hence,a {@link 29 * KeyDerivationKey} needs a specific ID if and only if the derived key needs a specific ID, and 30 * so this is always equal to {@code getDerivedParameters().hasIdRequirement()}. 31 */ 32 @Override hasIdRequirement()33 public boolean hasIdRequirement() { 34 return getDerivedKeyParameters().hasIdRequirement(); 35 } 36 } 37