我想将以下 Java 代码转换为 iOS。请帮帮我。
CMSSignedDataParser sp = new CMSSignedDataParser(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build(), contents.getBuffer());
sp.getSignedContent().drain();
Store certStore = sp.getCertificates();
SignerInformationStore signers = sp.getSignerInfos();
Collection c = signers.getSigners();
Iterator it = c.iterator();
while (it.hasNext())
{
SignerInformation signer = (SignerInformation)it.next();
Collection certCollection = certStore.getMatches(signer.getSID());
Iterator certIt = certCollection.iterator();
X509CertificateHolder cert = (X509CertificateHolder)certIt.next();
X509Certificate certificate = new JcaX509CertificateConverter().setProvider( "BC" ).getCertificate( cert );
}
在 Java 中,从 Signed Info 中提取 X509 证书。如何在 iOS 中实现相同的功能?