}
private boolean verifyDetached(final byte[] data, final byte[] signature) throws CMSException, IOException, OperatorCreationException, GeneralSecurityException {
InputStream inputStream = new ByteArrayInputStream(data);
DigestCalculatorProvider digestCalculatorProvider = new BcDigestCalculatorProvider();
CMSSignedDataParser signedDataParser = new CMSSignedDataParser(digestCalculatorProvider, new CMSTypedStream(inputStream), signature);
CMSTypedStream signedContent = signedDataParser.getSignedContent();
signedContent.drain();
CollectionStore certificatesStore = (CollectionStore) signedDataParser.getCertificates();
boolean verified = true;