-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for openJDK in FIPS mode. Fix issue #614
- Loading branch information
1 parent
75bedb1
commit 75c319b
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.NoSuchProviderException; | ||
import java.security.Provider; | ||
import java.security.Provider.Service; | ||
import java.security.Security; | ||
|
||
public class JCEProviderInfo | ||
{ | ||
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchProviderException | ||
{ | ||
System.out.printf("JCE Provider Info: %s %s/%s on %s %s%n", System.getProperty("java.vm.name"), | ||
System.getProperty("java.runtime.version"), | ||
System.getProperty("java.vm.version"), | ||
System.getProperty("os.name"), | ||
System.getProperty("os.version")); | ||
|
||
Provider[] ps; | ||
if (args.length > 0) | ||
{ | ||
System.out.printf("Searching for JCA Security Providers with filter=\"%s\"%n", args[0]); | ||
ps = Security.getProviders(args[0]); | ||
|
||
} else { | ||
System.out.printf("Listing all JCA Security Providers.%n"); | ||
ps = (args.length>0)?Security.getProviders(args[0]):Security.getProviders(); | ||
} | ||
if (ps == null || ps.length == 0) | ||
{ | ||
System.out.printf("No Results.%n"); | ||
return; | ||
} | ||
for(Provider p : ps) | ||
{ | ||
System.out.printf("--- Provider %s %s%n info %s%n", p.getName(), p.getVersion(), p.getInfo()); | ||
for(Service s : p.getServices()) | ||
{ | ||
System.out.printf(" + %s.%s : %s (%s)%n tostring=%s%n", s.getType(), s.getAlgorithm(), s.getClassName(), s.getProvider().getName(), s.toString()); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import javax.net.ssl.SSLContext; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.Provider; | ||
import java.security.Security; | ||
|
||
public class Tcheck { | ||
|
||
public static void main(String[] args) { | ||
int i = 1; | ||
System.out.println("Supported Security Providers:"); | ||
Provider [] providers = Security.getProviders(); | ||
|
||
for (Provider provider: providers) { | ||
System.out.println(" " + i++ + ". " + provider.getInfo()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters