0
我想將以下Java代碼轉換爲iOS。請幫助我。從已簽名的信封數據獲取X509證書
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中從簽名信息中提取X509證書。如何在iOS中實現同樣的事情?
看起來CMS CMS現已公開:https://developer.apple.com/library/mac/documentation/security/Reference/CryptoMessageRef/Reference/reference.html#//apple_ref/doc/uid/TP40006264 –
它在MacOSX上公開,但不在iOS上。 –