Questions tagged [java-security]

Java security technology is set of libraries, tools, and implementations of commonly used security algorithms, mechanisms, and protocols including cryptography, public key infrastructure, secure communication, authentication, and access control

Java security technology is set of libraries, tools, and implementations of commonly used security algorithms, mechanisms, and protocols. The Java security APIs includes cryptography, public key infrastructure, secure communication, authentication, and access control. Java security technology provides the developer with a comprehensive security framework for writing applications, and also provides the user or administrator with a set of tools to securely manage applications.

Underlying the Java SE Platform is a dynamic, extensible security architecture, standards-based and interoperable. Security features — cryptography, authentication and authorization, public key infrastructure, and more — are built in. The Java security model is based on a customizable "sandbox" in which Java software programs can run safely, without potential risk to systems or users.

399 questions
5
votes
0 answers

How to generate ECDSA keys with brainpool curve in PKCS11 based SafeNet HSM?

I am trying to generate the ECDSA Keys using brain pool curve at the Safenet HSM. I enabled the user-defined domain parameters at the Safenet HSM and we are facing exception java.security.InvalidAlgorithmParameterException: params must be either a…
Ahmad
  • 1,462
  • 5
  • 17
  • 40
5
votes
2 answers

Swift RSA Encryption Public Key to Java Server is failing

I am trying to create public base64 key from RSA Private key using Security framework. Here is snippet. let tag = "com.example.keys.mykey" public extension SecKey { static func generateBase64Encoded2048BitRSAKey() throws -> (private: String,…
Ankit Thakur
  • 4,739
  • 1
  • 19
  • 35
5
votes
2 answers

Using PCKS#12 certifcate with non-ASCII password

I trying to open PKCS#12 file, but because password is not ASCII (contains polish characters) I getting "Password is not ASCII" exception when executing KeyStore.load(). Is there any solution to using this certificate?
Piotr S
  • 51
  • 1
  • 2
5
votes
0 answers

created java truststore.p12 using only openssl

I'm generating self-signed certs as part of an installation process and don't want to install the JDK in order to get keytool (which, undeniably would make the problem easier. Per: previous discussion, the PKCS12 truststore bag has to have the…
rockfan
  • 59
  • 6
5
votes
2 answers

No such algorithm: PKCS11 for provider SunPKCS11-CartaoCidadao

There are my current providers: 0 - Provider name: SUN 1 - Provider namer: SunRsaSign 2 - Provider name: SunEC ... 9 - Provider name: SunPKCS11-CartaoCidadao The ninth provider is the one that I'm trying to use, which uses the pkcs11…
Marco Ventura
  • 51
  • 1
  • 4
5
votes
1 answer

SunPKCS11 provider not found with keytool

I am running the following command with java 9 : keytool -keystore NONE -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg pkcs11conf -list and get the flowing error : keytool error: java.lang.Exception: Provider …
Saar peer
  • 817
  • 6
  • 21
5
votes
1 answer

toDerInputStream rejects tag type 0 - Cannot read key from keystore

In my Android app, I have a keystore file named keystore.p12, which is located in /data/data/com.company.myapp/files. I pulled this particular file and now I want to retrieve the key stored inside it. I tried it with the keytool like…
John Doe
  • 113
  • 1
  • 2
  • 11
5
votes
1 answer

How the host's forward and backward DNS entries match in java application makes it secure from DNS spoofing

I am using fortify and it is showing the vulnerability by which the attacker can do DNS spoofing while I am trying to get hostname in the java application. I have got one solution that by matching forward DNS and Reverse DNS entries it can be…
4
votes
1 answer

java.security.properties - changes not applied

I try to append security properties to java.security. Hence I add a property "java.security.properties" specifying the file to be appended. I checked that security.overridePropertiesFile is set to true. For some reason the changes to the security…
Lao Tse
  • 171
  • 3
  • 12
4
votes
1 answer

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException

Situation : (1) I am on Android Studio 4.1 and trying to build a sample Android Application (2) I am behind the Proxy and Proxy settings working fine as I am able to download and install SDKs I am getting the below error : I tried all possible…
Raulp
  • 7,758
  • 20
  • 93
  • 155
4
votes
1 answer

Is it possible to avoid jvm security by using JNI?

I have been thinking about the way jvm security works. The principle is that jvm always trusts and runs any native code. So, conceptually if your code does not call checkpermission(permission) whether explicitly or implicitly, it means it will never…
Turkhan Badalov
  • 845
  • 1
  • 11
  • 17
4
votes
0 answers

PS256 algorithm support for signatures in Java

According to the Java 12 security specs here the RSASSA-PSS signature scheme should be supported (actually as of Java 11). However, if I try to use a signature with PS256 algorithm in my JWT using e.g. the nimbus jose+jwt library, then it doesn't…
user1120821
  • 439
  • 7
  • 18
4
votes
2 answers

Java 11 SSL exception: unable to find valid certification path to requested target

During an attempt to upgrade one of my applications from java 8 to java 11, I run into a weird SSL exception about "unable to find valid certification" the provisioning of this application overwrites default jdk / jre cacerts with cacerts from…
xdu
  • 543
  • 2
  • 5
  • 16
4
votes
0 answers

validate signature for saml2 response redirect java sha256 encryption

I'm trying to validate SAML response in order to redirect the client to appropriate page. Here is my Servlet: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String samlParam…
Emrah Mehmedov
  • 1,492
  • 13
  • 28
4
votes
1 answer

What prevents someone from subverting qualified exports by pretending to be a module they are not?

Given: module A { exports fuzzy.bunny to B; } What prevents a malicious player from pretending to be module B in order to gain access to module A's secrets? I know that Java has some sort of signing mechanism in META-INF that allows each module…
Gili
  • 86,244
  • 97
  • 390
  • 689
1 2
3
26 27