Questions tagged [bouncycastle]

Bouncy Castle is a cryptography API providing various cryptography, encryption, and security protocols. There are fairly similar libraries in both C# and Java that implement the API. Additionally, Bouncy Castle provides a JCE-compliant crypto provider for Java.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Where can I find bctls-fips-debug jar?

I can find bc-fips-debug jar in Maven Central but seems like there is no bctls-fips-debug one. This is strange because my google search actually returns some result where this jar is mentioned, such ...
yaroslav's user avatar
0 votes
0 answers
26 views

How to generate keystore and how to activate CSR/certificate from a keystore

I want to know how I may able to generate a keystore using java code and how am I supposed to activate a CSR/certificate from it (keystore)? I am trying to generate a keypair using BouncyCastle from ...
zen's user avatar
  • 13
0 votes
1 answer
38 views

Sphincs+ and SubjectPublicKeyInfo

Hey I was trying to generate a Sphincs+ public key/private key. And I wanted to write tbe public key into a pem file for future use. My appraoch was to use SubjectPublicKeyInfo to get the public key ...
Alex's user avatar
  • 1
0 votes
1 answer
45 views

Sphincs+ in Bouncy Castle

I was trying to understand how to use Sphincs+. package cdss; import java.io.IOException; import java.security.SecureRandom; import org.bouncycastle.pqc.crypto.sphincsplus....
Alex's user avatar
  • 1
0 votes
0 answers
33 views

Verification of signature without signed attributes using Bouncy Castle 1.70

I've started working on this project where we use Bouncy Castle for verification of digital signatures and we stumbled upon a bug. This is verification method: ` private Set<TLName> ...
Štěpán Vejvoda's user avatar
0 votes
1 answer
52 views

Digital Signature using itext7 and boundy castle (.net razor pages)

At the moment I wanted to create a digital signature using itext7 and boundy caste on .net razor pages. I found a old tutorial : https://viewbag.wordpress.com/2019/12/24/pdf-digital-signatures-itext7-...
slim's user avatar
  • 3
0 votes
0 answers
54 views

How do i encrypt with Java/BouncyCastle and decrypt with eg. OpenSSL

I'm experimenting with BouncyCastle to encrypt a string or file and then decrypt it with the openssl command line tool. I have done the encryption like this String text = "Asdf"; String ...
jka_dk's user avatar
  • 421
-2 votes
0 answers
19 views

Decrypt the PGPOnePassSignatureList Data

I have tried to decrypt a file provided by the client. The file type is of PGPOnePassSignatureList. I'm unable to move further. Here is the sample code I'm using for decrypting the file. static void ...
Harmeet Kaur's user avatar
0 votes
0 answers
33 views

Not able to get the Certificate Chain while exporting an End Entity X.509 Certificate generated using Bouncy Castle in Java

I have generated an X509 Certificate like this: public static X509Certificate createEndEntity( X509Certificate signerCert, PrivateKey signerKey, String sigAlg, PublicKey certKey) throws ...
mister.durden's user avatar
0 votes
0 answers
17 views

CMSException message-digest attribute value does not match calculated value

I am trying to sign a text using PFX in java. But the verification system(which is a centralized system and we do not have any access over it) is sending me nack messages saying signature mismatch. ...
user3176357's user avatar
0 votes
0 answers
47 views

How to sign a string using SHA1WITHRSA, X509Certificate2 and BouncyCastle in .NET?

I am currently working on a project where I have to sign an XML document to send it to a webservice. I have tried several code snippets I could find here and around the web, but have not yet achieved ...
Jay Weber's user avatar
0 votes
1 answer
48 views

How do I write embedded pgp signatures in Java using bouncyCastle?

I am trying to sign an encrypt a message in pgp, with an embedded signature. I am able to create a detached signature with the code below, using bouncyCastle's pgp libraries to sign and encrypt : ...
Robin Reuteler's user avatar
-1 votes
0 answers
11 views

How to access open.quantumsafe.org servers from an android app?

I want to configure an android app to connect to quantum safe server. For testing purposes I want to connect to open.quantumsafe.org servers. They have provided the CA certificate, So I want to ...
Arslan Shahid's user avatar
0 votes
1 answer
84 views

Generate Ed25519 keys in Java

I'm trying to generate keys of type Ed25519 on Android. Right now i use the library org.bouncycastle:bcpkix-jdk15on. This is my code: val keyPairGenerator = Ed25519KeyPairGenerator() keyPairGenerator....
wiiznokes3's user avatar
-4 votes
2 answers
214 views

Get private and public keys as a String and store then into PostgreSQL DB

I use this code generate a private and a public certificate: Security.addProvider(new BouncyCastleProvider()); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA", "...
Peter Penzov's user avatar
-3 votes
1 answer
191 views

Generate public and private key and get private key signature

I want to use org.bouncycastle:bcprov-jdk15on:1.54 in order to generate a public and private key with Bouncy castle. I tried to follow this tutorial: https://www.baeldung.com/java-bouncy-castle but ...
Peter Penzov's user avatar
1 vote
1 answer
75 views

C# How to get an RSA Instance from String of Public and Private Keys?

I'm building my own .NET Standard 2.0 library for DocuSign's API and I need to get an RSA instance from the public and private key strings they generated so I can create the JWT. While I was ...
Gup3rSuR4c's user avatar
  • 9,155
0 votes
1 answer
48 views

Reason for the error: "input too short", when encrypting (with FPE and bouncy castle) in Java/Scala

Based on the answers of this another question, I am trying to encrypt some text but when the input data is 3 characters or less in lenght, I obtain this exception: Exception in thread "main" ...
Gustach's user avatar
  • 63
0 votes
0 answers
22 views

Create PGPKeyRing using BouncyCastle C# API to be used with OpenKeyChain/Smart-PGP/GnuPG

I need help on how to correctly generate PGPKeyring that contains 3 keys each for signing, encryption, and authentication. These keys to be uploaded to a smartcard with SmartPGP applet. I have ...
of32 inc's user avatar
  • 105
0 votes
1 answer
68 views

Instance for X448 in Bouncy Castle gives error

I am trying to generate Key pairs with Bouncy Castle and use the following Bouncy implementation and code: implementation 'org.bouncycastle:bcprov-jdk15to18:1.70' According to: https://javadoc.io/...
Riccoh's user avatar
  • 359
0 votes
0 answers
22 views

Openssl command to Java or Loading Pem with encrypted key and cert into keystore

I am looking to convert this command to java so that i can convert a pem file to the p12 format to be used in the application key store: openssl pkcs12 -export -inkey combinedCertAndKey.pem -in ...
Ken's user avatar
  • 127
0 votes
1 answer
73 views

PDFBOX showing verified signature for tampered PDF file

Using the below code "Show Signature code" for verifying the signature: https://apache.googlesource.com/pdfbox/+/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/...
Rajat Gaur's user avatar
0 votes
0 answers
24 views

How to know if Keycloak 21.X is running on FIPS mode

I am running Keycloak 21.1.1 in a containerized environment. I have added the recommended bouncy castle jar files as providers and also using a BCKFS keystore with following env variables. ENV ...
kabi Patt's user avatar
1 vote
1 answer
50 views

Data encrypted with mbedtls not decrypting properly with Bouncy Castle

I have a microcontroller using mbedtls to encrypt data, which is transmitted to a Windows computer where it must be decrypted using Bouncy Castle. AES256 in CBC mode, with a 16-byte initialization ...
russ's user avatar
  • 65
-2 votes
2 answers
115 views

Is it possible to decrypt a PGP file using only the Public key and Passphrase, without the need for the private key?

I have a task at hand that requires decrypting a PGP file using only the public key and passphrase, without access to the private key. The client has not provided the private key and insists on using ...
RAKESH YEDLAPPALLI's user avatar
0 votes
0 answers
40 views

Various encryption results using a public key in Android and OpenSSL

I am encrypting a string in Android using a public key like this: public static String encryptDataWithPEM(String data, String publicKeyPEM) { try { PublicKey publicKey = ...
Aina T's user avatar
  • 1
0 votes
1 answer
33 views

SurefireBooterForkException- org/bouncycastle/asn1/DEREncodable

Local Environment: Windows 10 JDK 1.8 Maven 3.6.3 SpringBoot 2.0.9 Surefire 2.21.0 bcprov-jdk15on v.1.58 itextpdf 5.5.13 There are no issues on my local development environment. All test are ...
NotWoz's user avatar
  • 23
0 votes
0 answers
19 views

Not able to import root.crt in truststore.jks using .net code

I wrote a .net program to generate .jks file and import root.crt in .jks file, I am using .net and bouncy castle library to do this. Below is my code: `public void GenerateTrustStore(string ...
sk101's user avatar
  • 13
0 votes
0 answers
10 views

trying to sign the governance and permission certificate using ECDSA based CA certificate in Java for Cyclone DDS

I am trying to sign the governance and permission certificate using ECDSA based CA certificate in Java for Cyclone DDS, Here are couple of references https://www.tabnine.com/code/java/methods/java....
Manasa .M's user avatar
0 votes
0 answers
30 views

Correct method to sign an XML document using S/MIME with a PKCS7 keystore containing a private key and its X.509 certificate

private static byte[] signXML(byte[] xmlData, X509Certificate certificate, PrivateKey privateKey) throws IOException, OperatorCreationException, CertificateEncodingException, MessagingException, ...
Manasa .M's user avatar
-2 votes
1 answer
167 views

Verify digital signature signed using ED25519

My task is to verify a digital signature signed using ED25519. The signature that was generated using typescript Crypto and I need to verify in Java. I am using BouncyCastle to verify and here is my ...
ss_java's user avatar
0 votes
0 answers
100 views

org.bouncycastle.openpgp.PGPException: Encrypted message contains a signed message not literal data

I have an encrypted csv type file that I created via pgptool and I want to decrypt this file in my java application using the Bouncy Castle library, but I get the error "Encrypted message ...
Semih's user avatar
  • 5
0 votes
0 answers
17 views

How to use BouncyCastle for C# with non-exportable keys from the Microsoft Software Key Storage Provider?

I have an RSA keypair stored in the Microsoft Software Key Storage Provider and marked as non-exportable. I want to sign some data using the private key. Does BouncyCastle support such functionality? ...
ralien's user avatar
  • 1,448
0 votes
0 answers
92 views

SpringBoot Import Issue : org.bouncycastle.openssl

I need help about Spring import. I want to import 'import org.bouncycastle.openssl.PEMParser'. In my build.gradle, there is "implementation 'org.bouncycastle:bcprov-jdk15on:1.70'" All ...
이기태's user avatar
1 vote
0 answers
25 views

Bouncycastle - how to get attached file from detached signature file

I have myCMS CMSSignedData, but it only contains info about signatures, and no content (because it is detached) Now i want to get full attached, using this myCMS, how to do that? byte[] ...
Beigut Beisenkhan's user avatar
1 vote
2 answers
134 views

Micronaut - SSL with BouncyCastle Keystore - BCFKS not found

I'm enabling SSL in an micronaut application and specifically I need to use BouncyCastle BCFKS type keystore. But the application doesn't run with the config provided. ssl: enabled: true key-store:...
Raghav D's user avatar
0 votes
0 answers
33 views

c# BouncyCastle decrypt byte array with a password

I am trying to replicate the following javascript (which uses openpgp): const encryptedMessage = await readMessage({ binaryMessage: Uint8Array.from(encrypted_data.data), // parse encrypted bytes })...
LindleyLentati's user avatar
1 vote
1 answer
208 views

How to validate an incoming client certificate with Azure App Service / Functions? Only possible with `Bouncy Castle`?

In an Azure Function app I need to expose a public HTTP endpoint but want to make it as secure a possible. I intend to use certificate-based auth as one part of the solution. I have managed to get ...
baouss's user avatar
  • 1,312
0 votes
1 answer
116 views

Bouncy Castle upgrade to 1.70 is not working

I have an existing PGP v 1.60 code in project. now I need to update to 1.70 and it's throwing following error while compiling the code after update. incompatible types: java.util.Iterator<org....
Wolverine's user avatar
0 votes
2 answers
81 views

org.bouncycastle.tls.TlsFatalAlert: internal_error(80); TLS 1.3 credentials unhandled ,java 11,TLS version 1.3,BouncyCastle(1.72)

Due to below piece of code: public int[] getCipherSuites() { return Arrays.concatenate(super.getCipherSuites(), new int[] { CipherSuite....
Shivangi verma's user avatar
0 votes
0 answers
60 views

PS256 Signature verification Android using Kotlin using BouncyCaslte throws not such algorithm found

I am trying to implement PS256 verification in android over Kotlin using BouncyCastle. I have read the documentation of BouncyCastle where they list SHA256withRSAandMGF1 as an available algorithm in ...
Sarthak's user avatar
  • 188
1 vote
0 answers
110 views

Does Java 8 with Bouncy Castle as security provider support X25519 namedgroup?

I am using java 8 (1.8.0_332-b09) and bouncy castle as security provider for establishing a TLS 1.3 connection. As part of handshake, Client Hello in packetcapture shows the supported namedgroups as ...
Discovery's user avatar
-1 votes
1 answer
89 views

Bouncy Castle and CryptoJS vs Pycryptodome and Cryptography - who's right and how to decrypt the data in Python?

Let me explain. I have some data encrypted by Bouncy Caste library (AES 128 CBC). I am able to decompress the data using Crypto.js: var CryptoJS = require('crypto-js') const ivHexString = '...
Marek Marczak's user avatar
0 votes
0 answers
87 views

Add support for AES-GCM for TLS in Java 7

First of all, I premise that I am fully aware that Java 7 is EOL, vulnerable, extremely old and should not be used in 2023, but I need to mantain a legacy application which requires Java 7. I cannot ...
Ricky Sixx's user avatar
0 votes
1 answer
141 views

Bouncy Castle (1.72 version) Upgrade for java 11, org.bouncycastle.tls.TlsFatalAlert: handshake_failure(40); No selectable cipher suite

org.bouncycastle.tls.TlsServerProtocol srvPro = new TlsServerProtocol(con.getInputStream(), con.getOutputStream()); srvPro.accept(server); is causing Exception :org.bouncycastle.tls.TlsFatalAlert: ...
Shivangi verma's user avatar
0 votes
1 answer
40 views

Unable to encrypt file using bouncycastle lib

Hi I am trying to encrypt a text file using bouncycastle lib but getting this error java.io.IOException: DER length more than 4 bytes THis is the code public class RSAEncryptFile { public static ...
hitesh's user avatar
  • 449
0 votes
1 answer
32 views

Export a Pkcs10CertificationRequest object to a .pem file

I have been testing Bouncy Castle in C#. I have not found a way to export a Pkcs10CertificationRequest object to a .pem file. I have tried with PemWriter objects but I have not succeeded. It can be ...
Fiallo's user avatar
  • 3
0 votes
0 answers
134 views

Spring Boot 3.1 + Bouncy Castle has very slow startup time

I have Spring Boot project with Gradle and Java 17. I add dependency implementation("nl.martijndwars:web-push:5.1.1") implementation("org.bouncycastle:bcprov-jdk18on:1.70"...
Skyfall174's user avatar
0 votes
1 answer
45 views

0x80070520 when adding binding with programmatically generated X509Certificate2 on remote server

I'm trying to programmatically install a X509Certificate2 on remote Server. The X509Certificate2 is generated by merging a Private Key in PEM format and a .crt file provided by a certification ...
Vasco's user avatar
  • 1
0 votes
0 answers
148 views

How to resolve JCE cannot authenticate the provider BC?

I am working on a jar file in java. To work on that I need bouncy castle installed. I will later convert this into java google cloud function so I don't want any dependency with the system. When I try ...
Renee's user avatar
  • 179

1
2 3 4 5
63