Unable to verify the Signature with two different mechanism
问题 I have two clients, first client expect CMS/PKCS to verify signature second client expect only signature (EncryptedDigestMessage). Original file and certificate separately to verify signature So, I want to create one method that should return the appropriate output based on format (PKCS or SignOnly) public static byte[] digitalSign(byte[] fileContent , PrivateKey privkey , X509Certificate x509Certificate , String format) throws Exception{ Security.addProvider(new BouncyCastleProvider()); List