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.
2,939
questions
0
votes
0
answers
21
views
How to update the content of ASN1 file and parse this ASN1 file with updated content by bouncycastle? [closed]
I have application where required to read the Template Raw of ASN1 file and updated some information and reparse this ASN1 file with updated content. May I know if this is doable by using bouncycastle ...
0
votes
0
answers
14
views
Bouncycastle with NIST Algorithm 2.16.840.1.101.3.4.1.42 as Cipher
Hello I want to use the NIST Algorithm 2.16.840.1.101.3.4.1.42 in a P12 to wrap the key and to ecnrypt data. But when using it with BouncyCastle as provider I get the error "NoSuchAlgorithm for ...
0
votes
0
answers
28
views
EdDSA in bouncy castle
I have code that makes use of the java bouncy castle libraries for encryption, decryption and signature verification.
Now I came across the situation where a third party has shared their public key ...
0
votes
0
answers
50
views
Signature level(PAdES-B/T/LT/LTA) using PDFBox?
Is there any way I can display the signature level(PAdES B/T/LT/LTA) using PDFBox?
I checked the ShowSignature.java class, but I didn't find anything like that.
2
votes
1
answer
31
views
How do I sign a TransactionHex with SeedHex using secp256k1 in C# with Bouncy Castle?
I have this nodejs snippet which I want to implement in C#.
The SignTransaction function takes in a seedHex string (length: 64) and a TransactionHex string, a signature is created using secp256k1 ...
0
votes
0
answers
25
views
package org.bouncycastle.jce.provider does not exist [duplicate]
I am trying to use bouncy castle in Java but keep getting this error:
packacge org.bouncycastle.jce.provider does not exist
I'm using intellij, I have the bouncycastle jar in my CLASSPATH environment ...
0
votes
0
answers
27
views
Tomcat server not coming up
Catalina log is throwing the below error.
I have tried checking if the keystore is valid through keytool command and it is showing properly.
Not sure if I need to set anything from catalina side to ...
0
votes
1
answer
42
views
Convert ECDSA secp521r1 private key into PEM format using bouncy castle
We are programatically generating ECDSA private/public key in java as follows:
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC");
keyPairGenerator.initialize(new ...
1
vote
1
answer
13
views
KeyId is 0 for PgpPublicKeyEncryptedData
When I'm reading the encrypted file to understand with which public key it has been encrypted for, for some reason the KeyId property is 0.
Here's the code I've been using so far, which has worked, I ...
0
votes
1
answer
57
views
How to replicate bouncycastle CMSEnvelopedData decryption using Openssl
I have working code that uses Java Bouncycastle lib that (as I understood) decrypts CMS data.
byte[] encryptedData = Base64.decode(encryptedText);
CMSEnvelopedData cmsEnvelopedData = new ...
0
votes
1
answer
26
views
Elliptic Curve DSA in Bouncy Castle - what do h and n stand for?
I am trying to re-construct an ECPublicKey (generated by a smart card) in java with BouncyCastle.
I have this code, found from an example online:
KeyFactory keyFact = KeyFactory.getInstance("EC&...
1
vote
1
answer
28
views
How to set up BouncyCastle
I'm having some trouble setting up bouncycastle.
I've downloaded the jar, put it in Java\jre1.8.0_271\lib\ext, added it to java.security in the providers list and added it to the classpath.
When ...
0
votes
0
answers
87
views
PGP BouncyCastle + Kleopatra Decryption: Unknown Packet Type: 20
I am attempting to decrypt a file using BouncyCastle in C# that has been encrypted with RSA via Kleopatra. Unfortunately, I am receiving an error that states "Unknown packet type encountered: 20&...
1
vote
1
answer
80
views
Validate with Bouncy Castle ECDsaSigner
I am trying validate the message digest hash using eCDsaSigner with R and S but VerifySignature returns false
.
Is it possible to get more information as to why eCDsaSigner fails? I am sure the hash ...
0
votes
0
answers
27
views
RSAEngine Index was outside the bounds of the array
I need to encrypt the AES key with public RSA key, but I do have a problem on return engine.ProcessBlock. It keeps giving me the error 'Index was outside the bounds of the array' and the blocksize is ...
0
votes
0
answers
41
views
Get ECDSA Public Key Attributes from PKCS11 Interop ObjectHandle
I'm trying to create a PKCS10/CSR from Keys stored in a HSM.
It works just fine for RSA, but for ECDSA I'm struggeling to get the public key attributes
for the AsymetricKeyParameter for the ...
2
votes
1
answer
80
views
Retrieving Signature R and S element from ASN.1 CMS Signature Bouncy Castle
I have an ASN.1 encoded detached CMS ECC signature - I used an online decoder to inspect it and can see the signature R and S values but I'm wondering how to actually get these 2 values.
SEQUENCE (1 ...
0
votes
0
answers
20
views
Bouncycastle PGP with multiple files
I am developing a tool to encrypt one or multiple files using PGP.
So far, I had no problem to encrypt a single files.
For encrypting several files, I had to resort to zip them in a single file, and ...
0
votes
1
answer
62
views
Bouncy Castle and TLS_RSA_WITH_AES_128_CCM
One of my test tools(I only have the binary), uses java for TLS communication.
Since standard java does not provide support, Bouncy Castle is used for ciphers that use CCM.
After configuring Bouncy ...
2
votes
1
answer
74
views
Bouncy Castle Configuration for TLS
I am using a test app that used java for TLS communication. Standard Oracle java is installed in my system.
I need to use the TLS_DHE_RSA_WITH_AES_128_CCM cipher suite, which is not supported by ...
0
votes
0
answers
46
views
Convert Bouncy Castle RSA sign to .NET 5 sign
I'm trying to remove the dependency on Bouncy Castle for a PowerShell module, whilst keeping it cross platform. Currently I have the following code:
function Invoke-CastleSign ($EncodedText, $...
0
votes
1
answer
59
views
Unable to decrypt PGP encrypted file into Stream from Azure Blob storage using C# scripting within script task of SSIS
I am trying to read the PGP encrypted file from Azure Blob Storage using SSIS package - Script Task- C# code into Stream, decrypt the file data into string and load to Azure SQL MI server. But I am ...
3
votes
0
answers
123
views
Bouncy Castle signature verification fails for known good signature
I'm working with a platform that sends and receives very large AS/2 S/MIME messages and have problems verifying the signature for multipart/signed. The signatures that are generated by my code are ...
0
votes
0
answers
39
views
org.bouncycastle.tls.TlsFatalAlert: handshake_failure(40)
[c.s.a.s.f.f.s.m.m.HealthCheckBase: ERROR] - Health Check: service at URL https://cobalt-gke.gk.cobalt.only.sap/auditpublish-dev/greeting responded with message I/O error on GET request for "...
0
votes
0
answers
48
views
Create X509Certificate From Base64 Encoded DER
I have a base64 encoded DER string (I am not sure because web service is not well documented. However I guess because I can parse with asn decoder). When I try create X509Certificate2 with following ...
0
votes
0
answers
27
views
Implementation of an IText's IExternalSignatureContainer with BouncyCastle to manage ECDSA-SHA384 signature
I am trying to implement an IExternalSignatureContainer (itext7) to sign PDF with belgian id card.
There is twa smartcard versions to deal with:
RSA/SHA256 signature
ECDSA/SHA384
I achieved to sign ...
-1
votes
0
answers
37
views
no such algorithm: ECDH for provider BC
I am trying to generate a keypair using ECDH with BC.
fun generateECKeys(): KeyPair? {
return try {
val parameterSpec: ECNamedCurveParameterSpec =
...
0
votes
0
answers
19
views
Decrypting GPG encrypted file from S3 using AWS Lambda and Bouncy Castle
I have some likely crude code to try to decrypt an
S3ObjectInputStream from within AWS lambda using BC Java.
I wrote a decryptInputStream() method to try to decrypt an object from
an S3InputStream ...
0
votes
1
answer
84
views
Generating and validating a signature with ED25519 expanded private key
I am building a encrypted messaging app over tor network and currently I'm struggling on using tor generated ed25519 private key to sign and verify any message.
Below piece of code works with a 32 ...
1
vote
0
answers
92
views
Create SSH ED25519 key with BouncyCastle for Rency SSH.NET in C#
I have to generate the public and the private keys with BouncyCastle in ED25519 version (NOT RSA) and I not able to generate it correct.
I have try with:
var gen = new Ed25519KeyPairGenerator();
var ...
0
votes
1
answer
146
views
PemReader.ReadObject() returns null when parsing private RSA key
I am trying to create and sign a JWT using RS256. It should all work except that the PemReader returns null as it parses the private key.
I can see in the VSCode debugger that the private key string ...
0
votes
1
answer
119
views
Generate ED25519 keys for ssh connection with Bouncy Castle c#
I have to generate che keys in ED25519 for SSH connection. I'm able to create the public and the private keys but not the key for ssh. Is there anyone who can help me?
Below my C# code.
Thanks
...
0
votes
0
answers
30
views
How to write below Cryptography code to Bouncy Castle library in C#
Below code is written in .net cryptography. Please suggest example to write using bouncy castle C#
var collection = new X509Certificate2Collection();
collection.Import(bytes?.FromPkcs7());
...
0
votes
0
answers
36
views
What is python equivalent of Bouncy castle's CMSSignedDataGenerator?
How do I use python to create digital signature of string? I want to add the certificates and CRLs contained in the given CertStore to the pool that will be included in the encoded signature block (...
0
votes
1
answer
79
views
RijndaelManaged Decryption in .net 5 not working
I have below code in .net framework to decrypt some information and it is working fine. I have been tasked to upgrade this code to .net 5 and the same code is not working.
Current code in .net ...
0
votes
0
answers
24
views
Add E-mail extension to a certificate (Java BouncyCastle)
I've a program where an user makes a certificate request and I need to add an e-mail identificator extension.
public void crearPetCertificado(String fichPeticion) throws OperatorCreationException, ...
0
votes
1
answer
69
views
Anypoint Studio how to configure BouncyCastle
Our goal is to connect to Sybase ASE DB from Anypoint Studio. This DB Server expects encrypted password. So we wrote the java code and able to make connection. In the java project added external ...
1
vote
0
answers
51
views
sshj/sftp unable to reach settlement even though BouncyCastle is loaded
I am trying to upload some file to a server using custom sshj/sftp fat jar. However I am stuck on a problem where dependency is reporting that it is unable to reach a settlement.
USAGE:
java -jar ...
...
0
votes
0
answers
44
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 ...
1
vote
1
answer
125
views
JAVA How to verify ECDSA signature when r or s are negative
I'm writing a chunk of code to check the signature
My code below works if r and s are positive
if not the verify fails.
My code is
PublicKey publicKey = cert.getPublicKey();
Signature ecdsaVerify = ...
-3
votes
1
answer
66
views
pgp encryption in node js similar to bouncy castle
I am looking for a package in nodejs which can help in the encryption of data using the public key which has been generated using bouncy castle in java and the encrypted data will be decrypted in ...
0
votes
1
answer
76
views
What is the reason of this issue org.bouncycastle.tls.TlsFatalAlert
What is the reason of this issue org.bouncycastle.tls.TlsFatalAlert,Client raised fatal(2) certificate_unknown(46) alert: Failed to read record
org.bouncycastle.tls.TlsFatalAlert: certificate_unknown(...
0
votes
0
answers
30
views
java.net.UnknownHostException: https-proxy.service
I am trying to add BCFIPS in my service, my testcase started failing after adding configuration for bcfips.
Provider: KeyPairGenerator.EC algorithm from: BCFIPS
Provider: KeyPairGenerator.EC algorithm ...
1
vote
1
answer
98
views
EST with Bouncy Castle
I try to request a new certificate via EST protocol from the EST test service URL “https://testrfc7030.com/”. The program uses Bouncy Castle for this.
I have already configured the EST service’s TA ...
0
votes
1
answer
369
views
Bouncy Castle - Certification Issue org.bouncycastle.tls.TlsFatalAlert: certificate_unknown(46)
I am trying to make my application FIPS compliant so i have added configuration for FIPS. But I am getting below errors while building my microservice. I am getting certification issue. My certificate ...
0
votes
1
answer
66
views
(ECDSA-BouncyCastle)Cryptographic Algorithm Validation Program(CAVP) Testing: Digital Signatures
We use ECDSA with secp256r1 in our project.Also we are using Bouncy Castle libraries. How can I CAVP using NIST test vectors?
I am newbie.Probably the answer is simple.
The link with the test vector ...
0
votes
1
answer
100
views
Pkcs7 signing in .Net with a certificate and a private key?
I have a working pkcs7 cryptography algorithm in Node.js
var forge = require('node-forge');
var fs = require('fs');
var privateKeyAssociatedWithCert = fs.readFileSync("certs\\confpack.key", '...
0
votes
0
answers
28
views
Is it possible to change the encryption algorithm of a pkcs12 in .Net 5?
I've got a pkcs12 which uses an encryption algorithm that's not supported on Windows server 2016. I know this is possible using Openssl but if this is not an option, is there a way in .Net 5 or even ...
0
votes
1
answer
76
views
Why doesn't this Java HttpsServer successfully complete a TLS handshake?
I've tried to set up the minimal possible HTTPS server in Java based on Simple Java HTTPS server, with one difference: it uses a dynamically generated certificate signed by a static CA. (The purpose ...
0
votes
0
answers
84
views
ed25519 signature java curve not supported
I'm trying to make a ECDSA signature using the ed25519 curve in Java, using the Bouncy Castle library.
I have managed to generate the keys and to be able to obtain the public key given the private key....