1

我想将以下 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 中实现相同的功能?

4

1 回答 1

0

查看CMSDecoder.hSecurity.framework。再加上您开始使用的 openssl 框架。

错误
API 在 iOS 上Cryptographic Message Syntax不公开。我猜它一直是openssl。对不起!

于 2013-11-26T11:31:03.853 回答