OpenSslEvpCtrlValues.java

  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.  * This enum is defined for OpenSslNative.ctrl() to allow various cipher
  21.  * specific parameters to be determined and set.
  22.  * see the macro definitions in openssl/evp.h
  23.  */
  24. enum OpenSslEvpCtrlValues {
  25.     INIT(0x00),
  26.     SET_KEY_LENGTH(0x01),
  27.     GET_RC2_KEY_BITS(0x02),
  28.     SET_RC2_KEY_BITS(0x03),
  29.     GET_RC5_ROUNDS(0x04),
  30.     SET_RC5_ROUNDS(0x05),
  31.     RAND_KEY(0x06),
  32.     PBE_PRF_NID(0x07),
  33.     COPY(0x08),
  34.     AEAD_SET_IVLEN(0x09),
  35.     AEAD_GET_TAG(0x10),
  36.     AEAD_SET_TAG(0x11),
  37.     AEAD_SET_IV_FIXED(0x12),
  38.     GCM_IV_GEN(0x13),
  39.     CCM_SET_L(0x14),
  40.     CCM_SET_MSGLEN(0x15);

  41.     private final int value;

  42.     OpenSslEvpCtrlValues(final int value) {
  43.         this.value = value;
  44.     }

  45.     int getValue() {
  46.         return value;
  47.     }
  48. }