test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.java
author prr
Fri, 25 May 2018 12:12:24 -0700
changeset 50347 b2f046ae8eb6
parent 47216 71c04702a3d5
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47112
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     1
/*
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     4
 *
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     8
 *
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    13
 * accompanied this code).
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    14
 *
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    18
 *
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    21
 * questions.
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    22
 */
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    23
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    24
import java.security.Provider;
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    25
import java.security.Security;
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    26
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    27
public class ReadConfInUTF16Env {
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    28
    public static void main(String argv[]) {
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    29
        Provider p = Security.getProvider("SunPKCS11");
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    30
        if (p == null) {
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    31
            p = Security.getProvider("SunPKCS11-Solaris");
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    32
            if (p == null) {
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    33
                System.out.println("Skipping test - no PKCS11 provider available");
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    34
                return;
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    35
            }
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    36
        }
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    37
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    38
        System.out.println(p.getName());
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    39
    }
fe70db821411 8187023: Cannot read pkcs11 config file in UTF-16 environment
igerasim
parents:
diff changeset
    40
}