/** * Verify CMS Signed Data * @param cmsMsgType The CMS message type * @param signedData The signed data * @throws KrbException e */ public static void verifyCmsSignedData(CmsMessageType cmsMsgType, SignedData signedData) throws KrbException { String oid = pkinitType2OID(cmsMsgType); if (oid == null) { throw new KrbException("Can't get the right oid "); } String etype = signedData.getEncapContentInfo().getContentType(); if (oid.equals(etype)) { LOG.info("CMS Verification successful"); } else { LOG.error("Wrong oid in eContentType"); throw new KrbException(KrbErrorCode.KDC_ERR_PREAUTH_FAILED, "Wrong oid in eContentType"); } }
/** * Verify CMS Signed Data * @param cmsMsgType The CMS message type * @param signedData The signed data * @throws KrbException e */ public static void verifyCmsSignedData(CmsMessageType cmsMsgType, SignedData signedData) throws KrbException { String oid = pkinitType2OID(cmsMsgType); if (oid == null) { throw new KrbException("Can't get the right oid "); } String etype = signedData.getEncapContentInfo().getContentType(); if (oid.equals(etype)) { LOG.info("CMS Verification successful"); } else { LOG.error("Wrong oid in eContentType"); throw new KrbException(KrbErrorCode.KDC_ERR_PREAUTH_FAILED, "Wrong oid in eContentType"); } }