protected String signerInformationToString(SignerInformation sigInfo) { if (sigInfo == null) { return null; } StringBuilder sb = new StringBuilder(); sb.append("ContentTypeOID="); sb.append(sigInfo.getContentType()); sb.append(", Issuer="); sb.append(sigInfo.getSID().getIssuer()); sb.append(", SerialNumber="); sb.append(sigInfo.getSID().getSerialNumber()); sb.append(", SignerInfoVersion="); sb.append(sigInfo.getVersion()); sb.append(", SignatureAlgorithmOID="); sb.append(sigInfo.getDigestAlgOID()); sb.append(", EncryptionAlgorithmOID="); sb.append(sigInfo.getEncryptionAlgOID()); sb.append(", isCounterSignature="); sb.append(sigInfo.isCounterSignature()); return sb.toString(); }
public void logSignerInfo(String msgPrefix, SignerInformation signer, MimeBodyPart part, X509Certificate cert) { if (logger.isDebugEnabled()) { try { logger.debug(msgPrefix + ": \n Digest Alg OID: " + signer.getDigestAlgOID() + "\n Encrypt Alg OID: " + signer.getEncryptionAlgOID() + "\n Signer Version: " + signer.getVersion() + "\n Content Digest: " + Arrays.toString(signer.getContentDigest()) + "\n Content Type: " + signer.getContentType() + "\n SID: " + signer.getSID().getIssuer() + "\n Signature: " + Arrays.toString(signer.getSignature()) + "\n Unsigned attribs: " + signer.getUnsignedAttributes() + "\n Content-transfer-encoding: " + part.getEncoding() + "\n Certificate: " + cert ); } catch (Throwable e) { logger.debug("Error logging signer info: " + org.openas2.logging.Log.getExceptionMsg(e), e); } } } }
public EncryptionAlgorithm getEncryptionAlgorithm() { String oid = signerInformation.getEncryptionAlgOID();
.getDigestAlgorithmID().getAlgorithm()); LOGGER.debug("pkiMessage encryption algorithm: {}", signerInfo.getEncryptionAlgOID());
ret.setDigestAlgorithm(digestAlgOid); String sigAlgOid = signerInfo.getEncryptionAlgOID(); if (!PKCSObjectIdentifiers.rsaEncryption.getId().equals(sigAlgOid)) { ASN1ObjectIdentifier tmpDigestAlgOid; try { tmpDigestAlgOid = ScepUtil.extractDigesetAlgorithmIdentifier( signerInfo.getEncryptionAlgOID(), signerInfo.getEncryptionAlgParams()); } catch (Exception ex) { final String msg = "could not extract digest algorithm from signerInfo.signatureAlgorithm: "
ret.setDigestAlgorithm(digestAlgOid); String sigAlgOid = signerInfo.getEncryptionAlgOID(); if (!PKCSObjectIdentifiers.rsaEncryption.getId().equals(sigAlgOid)) { ASN1ObjectIdentifier tmpDigestAlgOid; try { tmpDigestAlgOid = ScepUtil.extractDigesetAlgorithmIdentifier( signerInfo.getEncryptionAlgOID(), signerInfo.getEncryptionAlgParams()); } catch (Exception ex) { final String msg = "could not extract digest algorithm from signerInfo.signatureAlgorithm: "