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 the status of a key in a keyset. 23 * 24 * <p>Note that the status of a key is not part of the key itself, it is metadata about the key that 25 * is for example stored in a keyset. 26 */ 27 @Immutable 28 public final class KeyStatus { 29 public static final KeyStatus ENABLED = new KeyStatus("ENABLED"); 30 public static final KeyStatus DISABLED = new KeyStatus("DISABLED"); 31 public static final KeyStatus DESTROYED = new KeyStatus("DESTROYED"); 32 33 private final String name; 34 KeyStatus(String name)35 private KeyStatus(String name) { 36 this.name = name; 37 } 38 39 @Override toString()40 public String toString() { 41 return name; 42 } 43 } 44