Permalink
Browse files

Merge pull request #3 from megahall/master

fixes #2: unclear debug logs from CertStoreInspector
  • Loading branch information...
2 parents 8483856 + db9d7e2 commit 55ee4b91ce53253a789fc4bfd842693feb1371a6 @seize-the-dave seize-the-dave committed Mar 28, 2013
@@ -38,24 +38,24 @@ private void inspect() throws CertStoreException {
int i = 0;
for (Certificate cert : certs) {
X509Certificate x509 = (X509Certificate) cert;
- LOGGER.debug("{}. '[issuer={}; serial={}]'", new Object[] { ++i,
- x509.getIssuerDN(), x509.getSerialNumber() });
+ LOGGER.debug("{}. '[dn={}; serial={}]'", new Object[] { ++i,
+ x509.getSubjectDN(), x509.getSerialNumber() });
}
LOGGER.debug("Looking for recipient entity");
recipient = selectCertificate(store, getRecipientSelectors());
- LOGGER.debug("Using [issuer={}; serial={}] for recipient entity",
- recipient.getIssuerDN(), recipient.getSerialNumber());
+ LOGGER.debug("Using [dn={}; serial={}] for recipient entity",
+ recipient.getSubjectDN(), recipient.getSerialNumber());
LOGGER.debug("Looking for message signing entity");
signer = selectCertificate(store, getSignerSelectors());
- LOGGER.debug("Using [issuer={}; serial={}] for message signing entity",
- signer.getIssuerDN(), signer.getSerialNumber());
+ LOGGER.debug("Using [dn={}; serial={}] for message signing entity",
+ signer.getSubjectDN(), signer.getSerialNumber());
LOGGER.debug("Looking for issuing entity");
issuer = selectCertificate(store, getIssuerSelectors());
- LOGGER.debug("Using [issuer={}; serial={}] for issuing entity",
- issuer.getIssuerDN(), issuer.getSerialNumber());
+ LOGGER.debug("Using [dn={}; serial={}] for issuing entity",
+ issuer.getSubjectDN(), issuer.getSerialNumber());
}
/**
@@ -71,16 +71,16 @@ public PkcsPkiEnvelopeDecoder(final X509Certificate recipient,
validate(pkcsPkiEnvelope);
LOGGER.debug(
- "Decrypting pkcsPkiEnvelope using key belonging to [issuer={}; serial={}]",
- recipient.getIssuerDN(), recipient.getSerialNumber());
+ "Decrypting pkcsPkiEnvelope using key belonging to [dn={}; serial={}]",
+ recipient.getSubjectDN(), recipient.getSerialNumber());
final RecipientInformationStore recipientInfos = pkcsPkiEnvelope
.getRecipientInfos();
RecipientInformation info = recipientInfos
.get(new JceKeyTransRecipientId(recipient));
if (info == null) {
throw new MessageDecodingException(
- "Missing expected key transfer recipient");
+ "Missing expected key transfer recipient " + recipient.getSubjectDN());
}
LOGGER.debug("pkcsPkiEnvelope encryption algorithm: {}", info
@@ -80,8 +80,8 @@ public CMSEnvelopedData encode(final byte[] messageData)
}
edGenerator.addRecipientInfoGenerator(recipientGenerator);
LOGGER.debug(
- "Encrypting pkcsPkiEnvelope using key belonging to [issuer={}; serial={}]",
- recipient.getIssuerDN(), recipient.getSerialNumber());
+ "Encrypting pkcsPkiEnvelope using key belonging to [dn={}; serial={}]",
+ recipient.getSubjectDN(), recipient.getSerialNumber());
OutputEncryptor encryptor;
try {
@@ -88,7 +88,7 @@ public PkiMessageDecoder(final X509Certificate signer,
SignerInformation signerInfo = signerStore.get(new JcaSignerId(signer));
if (signerInfo == null) {
throw new MessageDecodingException("Could not for signerInfo for "
- + signer.getIssuerDN());
+ + signer.getSubjectDN());
}
LOGGER.debug("pkiMessage digest algorithm: {}", signerInfo
@@ -107,8 +107,8 @@ public PkiMessageDecoder(final X509Certificate signer,
X509CertificateHolder cert = (X509CertificateHolder) certColl
.iterator().next();
LOGGER.debug(
- "Verifying pkiMessage using key belonging to [issuer={}; serial={}]",
- cert.getIssuer(), cert.getSerialNumber());
+ "Verifying pkiMessage using key belonging to [dn={}; serial={}]",
+ cert.getSubject(), cert.getSerialNumber());
SignerInformationVerifier verifier;
try {
verifier = new JcaSimpleSignerInfoVerifierBuilder().build(cert);
@@ -124,8 +124,8 @@ public CMSSignedData encode(final PkiMessage<?> message)
CMSProcessable content = getContent(message);
LOGGER.debug(
- "Signing pkiMessage using key belonging to [issuer={}; serial={}]",
- signerId.getIssuerDN(), signerId.getSerialNumber());
+ "Signing pkiMessage using key belonging to [dn={}; serial={}]",
+ signerId.getSubjectDN(), signerId.getSerialNumber());
try {
CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
generator.addSignerInfoGenerator(getSignerInfo(message));

0 comments on commit 55ee4b9

Please sign in to comment.