Discussion:
CMSSignedData certificate store
Pellerin, Clement
2014-09-23 19:17:46 UTC
Permalink
I'm porting our SMIME code from BC 1.48 to BC 1.51.
What is the equivalent of this call:
CMSSignedData s = ...;
CertStore certs = s.getCertificatesAndCRLs("Collection", "BC");

The obvious answer is s.getCertificates() and s.getCRLs()
but the return type changed to org.bouncycastle.util.Store
The only method in this interface is getMatches()
Even the concrete implementations do not support a conversion back to CertStore
or any way to enumerate the certificates/CRLs.

The data might be hiding in CMSSignedData.signedData but that field is package private with no accessors.

I need the CertStore because I'm merging many CertStores into a MultiCertStore
before I call a JCA CertPathBuilder to check the signer certificate.
Carlos Oliva
2014-09-23 19:33:16 UTC
Permalink
Woudl this work?
signed = new org.bouncycastle.mail.smime.SMIMESigned(multipart,
transferEncoding);
java.security.cert.CertStore certsOnly = new
org.bouncycastle.cert.jcajce.JcaCertStoreBuilder().setProvider("BC").add
Certificates(signed.getCertificates()).build();

-----Original Message-----
From: Pellerin, Clement [mailto:Clement_Pellerin-/***@public.gmane.org]
Sent: Tuesday, September 23, 2014 3:18 PM
To: dev-crypto-***@public.gmane.org
Subject: [dev-crypto] CMSSignedData certificate store

I'm porting our SMIME code from BC 1.48 to BC 1.51.
What is the equivalent of this call:
CMSSignedData s = ...;
CertStore certs = s.getCertificatesAndCRLs("Collection", "BC");

The obvious answer is s.getCertificates() and s.getCRLs() but the return
type changed to org.bouncycastle.util.Store The only method in this
interface is getMatches() Even the concrete implementations do not
support a conversion back to CertStore or any way to enumerate the
certificates/CRLs.

The data might be hiding in CMSSignedData.signedData but that field is
package private with no accessors.

I need the CertStore because I'm merging many CertStores into a
MultiCertStore before I call a JCA CertPathBuilder to check the signer
certificate.
--
ExchangeDefender Message Security: Click below to verify authenticity
https://admin.exchangedefender.com/verify.php?id=s8NJXHpJ026297&from=carloso-***@public.gmane.org
Loading...