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;
19  
20  import org.apache.commons.crypto.random.CryptoRandom;
21  
22  /**
23   * JNI interface of {@link CryptoRandom} implementation for OpenSSL.
24   * The native method in this class is defined in
25   * OpenSslCryptoRandomNative.h (generated at build time by javah)
26   * and implemented in the file
27   * src/main/native/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.c
28   */
29  final class OpenSslInfoNative {
30  
31      /**
32       * Return the name used to load the dynamic linked library.
33       *
34       * @return the name used to load the library (e.g. crypto.dll)
35       */
36      public static native String DLLName();
37  
38      /**
39       * Return the path to the loaded dynamic linked library.
40       * [Currently not implemented on Windows]
41       * @return the path to the library that was loaded; may be null.
42       */
43      public static native String DLLPath();
44  
45      /**
46       * @return name of native
47       */
48      public static native String NativeName();
49  
50      /**
51       * @return timestamp of native
52       */
53      public static native String NativeTimeStamp();
54  
55  
56      /**
57       * @return version of native
58       */
59      public static native String NativeVersion();
60  
61      /**
62       * @return the value of OPENSSL_VERSION_NUMBER.
63       */
64      public static native long OpenSSL();
65  
66      /**
67       * Returns OpenSSL_version according the version type.
68       *
69       * @param type The version type
70       * @return The text variant of the version number and the release date.
71       */
72      public static native String OpenSSLVersion(int type);
73  
74      /**
75       * Makes the constructor private.
76       */
77      private OpenSslInfoNative() {
78      }
79  }