001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2019-2021 Ping Identity Corporation 026 */ 027package com.unboundid.directory.sdk.common.types; 028 029 030 031import java.util.Date; 032import java.util.Set; 033 034import com.unboundid.util.NotExtensible; 035import com.unboundid.util.ThreadSafety; 036import com.unboundid.util.ThreadSafetyLevel; 037 038 039 040/** 041 * This interface defines a set of methods that may be used to interact with an 042 * encryption settings definition. 043 */ 044@NotExtensible() 045@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE) 046public interface EncryptionSettingsDefinition 047{ 048 /** 049 * Retrieves a string representation of the primary identifier for this 050 * encryption settings definition. 051 * 052 * @return A string representation of the primary identifier for this 053 * encryption settings definition. 054 */ 055 String getPrimaryIDString(); 056 057 058 059 /** 060 * Retrieves a set of all identifiers that may be used to reference this 061 * encryption settings definition, including the primary identifier and any 062 * legacy identifiers that may have been used for this definition over time. 063 * 064 * @return A set of all identifiers that may be used to reference this 065 * encryption settings definition. 066 */ 067 Set<String> getAllIDStrings(); 068 069 070 071 /** 072 * Retrieves the cipher transformation used for this encryption settings 073 * definition. 074 * 075 * @return The cipher transformation used for this encryption settings 076 * definition. 077 */ 078 String getCipherTransformation(); 079 080 081 082 /** 083 * Retrieves the length of the GCM authentication tag in bits, if applicable. 084 * 085 * @return The length of the GCM authentication tag in bits, or -1 if it does 086 * not apply to this encryption settings definition. 087 */ 088 int getGCMTagLengthBits(); 089 090 091 092 /** 093 * Retrieves the name of the key factory algorithm used to generate the key 094 * for this encryption settings definition. 095 * 096 * @return The name of the key factory algorithm used to generate the key for 097 * this encryption settings definition. 098 */ 099 String getKeyFactoryAlgorithm(); 100 101 102 103 /** 104 * Retrieves the iteration count provided to the key factory algorithm in the 105 * course of generating the encryption key. 106 * 107 * @return The iteration count provided to the key factory algorithm in the 108 * course of generating the encryption key. 109 */ 110 int getKeyIterationCount(); 111 112 113 114 /** 115 * Retrieves the size in bytes of the salt provided to the key factory 116 * algorithm in the course of generating the encryption key. 117 * 118 * @return The size in bytes of the salt provided to the key factory 119 * algorithm in the course of generating the encryption key. 120 */ 121 int getKeySaltLengthBytes(); 122 123 124 125 /** 126 * Retrieves the length in bytes of the initialization vector that will be 127 * used with this encryption settings definition. 128 * 129 * @return The length in bits of the initialization vector that will be used 130 * with this encryption settings definition. 131 */ 132 int getInitializationVectorLengthBytes(); 133 134 135 136 /** 137 * Retrieves the length in bits of the key for this encryption settings 138 * object. 139 * 140 * @return The length in bits of the key for this encryption settings object. 141 */ 142 int getKeyLengthBits(); 143 144 145 146 /** 147 * Retrieves the time that this encryption settings definition was created, 148 * if available. 149 * 150 * @return The time that this encryption settings definition was created, or 151 * {@code null} if that is not available (because the definition was 152 * created before the create timestamp was recorded). 153 */ 154 Date getCreateTime(); 155 156 157 158 /** 159 * Retrieves a description for this encryption settings definition, if 160 * available. 161 * 162 * @return A description for this encryption settings definition, or 163 * {@code null} if no description is available. 164 */ 165 String getDescription(); 166 167 168 169 /** 170 * Retrieves a string representation of this encryption settings definition. 171 * 172 * @return A string representation of this encryption settings definition. 173 */ 174 @Override() 175 String toString(); 176}