View Javadoc
1    /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.commons.crypto.cipher;
19  
20  /**
21   * This enum is defined for OpenSslNative.ctrl() to allow various cipher
22   * specific parameters to be determined and set.
23   * see the macro definitions in openssl/evp.h
24   */
25  enum OpenSslEvpCtrlValues {
26      INIT(0x00),
27      SET_KEY_LENGTH(0x01),
28      GET_RC2_KEY_BITS(0x02),
29      SET_RC2_KEY_BITS(0x03),
30      GET_RC5_ROUNDS(0x04),
31      SET_RC5_ROUNDS(0x05),
32      RAND_KEY(0x06),
33      PBE_PRF_NID(0x07),
34      COPY(0x08),
35      AEAD_SET_IVLEN(0x09),
36      AEAD_GET_TAG(0x10),
37      AEAD_SET_TAG(0x11),
38      AEAD_SET_IV_FIXED(0x12),
39      GCM_IV_GEN(0x13),
40      CCM_SET_L(0x14),
41      CCM_SET_MSGLEN(0x15);
42  
43      private final int value;
44  
45      OpenSslEvpCtrlValues(final int value) {
46          this.value = value;
47      }
48  
49      int getValue() {
50          return value;
51      }
52  }