434 questions
2
votes
0
answers
62
views
How to initialise an SSLContext with trust defined by network_security_config.xml?
Within an Android app I am building an SSLContext in order to use a raw TLS socket to a remote service.
Rather than having to manually load a KeyStore with the necessary trust material in the correct ...
1
vote
0
answers
71
views
How to know a security provider supports a specific keysize without trying to init?
The Cipher states that Java platforms require to support following transformations and keysizes.
AES/CBC/NoPadding (128)
AES/CBC/PKCS5Padding (128)
AES/ECB/NoPadding (128)
AES/ECB/PKCS5Padding (128)
...
0
votes
1
answer
107
views
Implement a Java SecretKey that supports destruction and is thread-safe
I am writing a custom Java SecretKey implementation that supports destruction and is thread-safe. Please see my code below:
public class DSecretKey implements SecretKey, KeySpec {
final String ...
0
votes
2
answers
2k
views
JCE Cannot Authenticate Provider BC (bcprov-jdk18on-177.jar)
I have been using some library which has dependency on bcprov-jdk18on-177.jar. Using Oracle Jre I am facing Exception:JCE Cannot Authenticate Provider BC.
Although it is working fine with OpenJDK ...
0
votes
1
answer
193
views
Passing from JCE to Bouncy Castle (Blowfish)
I need to convert a JCE based code to a Bouncy Castle based code. I'm completely new to Bouncy Castle and couldn't find a easy-to-understand introduction to this topic in general or my issue ...
0
votes
0
answers
76
views
Export PKCS#8 from an EC PrivateKey
I try to generate a keypair and show the private key.
String provname = "BC";
KeyPairGenerator kpg = KeyPairGenerator.getInstance ("EC", provname);
kpg.initialize (new ...
1
vote
0
answers
118
views
JCE: Store a private-key only without cert-chain
With Java and JCE - I have to create a keypair, store it in a keystore and create a certificate-request.
As far I see I can only store a private-key with a certificate-chain.
But I do not have the ...
0
votes
0
answers
99
views
How to check if generated keypair matches?
Is there a way I can check if a private-key matches a public-key with Java JCE?
// generate a keypair
KeyPairGenerator kpg = KeyPairGenerator.getInstance ("RSA", provname);
kpg....
0
votes
0
answers
815
views
How to change jasypt algorithm in spring-boot application? why doesn't it work with default values?
In my Spring boot app I have following application.yml file:
jasypt:
encryptor:
password: secretKey
algorithm: "PBEWithMD5AndDES"
iv-generator-classname: org.jasypt.iv....
1
vote
3
answers
3k
views
Why does my encryption returns weird string of symbols as the encrypted text?
I am creating an algorithm where it has to encrypt and decrypt passwords by using JCE and AES. I will keep the encrypted text into a database, however I'm facing two problems. The first problem being ...
5
votes
1
answer
332
views
has anyone undergone certification of PCI-DSS using general purpose HSM (and not payshield)?
can we utilise a general purpose HSM for EMV related work ? like ARQC/ARPC ? PCI guidelines do not specifically prohibit general purpose HSM from being used. There are certain constraints (e.g. ...
0
votes
1
answer
2k
views
CKR_KEY_TYPE_INCONSISTENT: when deriving signing key in FIPS mode using SunPKCS11 with NSS
Environment details:
Java: openjdk-1.8.0.312
OS: RHEL8
Following are the security providers configured.
SunPKCS11-NSS-FIPS,
SUN 1.8,
SunEC 1.8,
SunJSSE 1.8
Note:
The issue disappears when added a new ...
3
votes
0
answers
718
views
AWS KMS Support for PGP encryption
I have a batch process that require PGP encryption for files before writing them to "Archive" location.
I read a little about PGP encryption using Java and learned that Bounsycastle does ...
0
votes
0
answers
1k
views
Signing using PKCS#11 tokens
Trying to read a PKCS#11 config stream and then extract certificate and private key. It is working but when trying to create a cipher instance of the private key, getting the below error:
Exception in ...
2
votes
0
answers
394
views
How to use cloudhsm java library
In the Amazon CloudHSM command line tools there is the command findKey which can take a bunch of different parameters to search for keys by type, class, label etc. The equivalent in the Java library ...