0

DSS フレームワークを使用して失効ステータスに基づいて X509 証明書を検証しようとしていますが、どこにありますか?

このコードを使用して、CRL と OCSP で証明書を検証しています。toValidateToken取り消されたのか知りたいです。

CertificateTokenクラスにはisSignatureValidisExpiredisValidOnなどのメソッドがありますが、失効に関連するメソッドはありません。

他のフォーラムで方法を見つけましたisRevoked()が、持っていません。すべての依存関係がインストールされていると確信しています。

CommonCertificateSource adjunctCertificateSource = new CommonCertificateSource();

// Firstly, we load the certificate to be validated
CertificateToken toValidate = getCertificateFromSignature(documentPath);
CertificateToken toValidateToken = adjunctCertificateSource.addCertificate(toValidate);

//Configure the certificate verifier using the trust store and the intermediate certificates
//OnlineOCSPSource and OnlineCRLSource will invoke the OCSP service and CRL
//distribution point extracting the URL  from the certificate
CertificateVerifier certificateVerifier = new CommonCertificateVerifier();
certificateVerifier.setAdjunctCertSource(adjunctCertificateSource);
certificateVerifier.setCrlSource(new OnlineCRLSource());
certificateVerifier.setOcspSource(new OnlineOCSPSource());

//Perform validation
CertificatePool validationPool = certificateVerifier.createValidationPool();
SignatureValidationContext validationContext = new SignatureValidationContext(validationPool);

validationContext.addCertificateTokenForVerification(toValidateToken);
validationContext.validate();

結果として、単純な true/false だけが必要です。

4

1 に答える 1

0

DSS フレームワークが何であれ... CRL と OCSP で有効性をチェックする方法の記事は次のとおりです。

以下の標準はRFC2315で定義された PKCS#7です。暗号化メッセージの構文は、いわゆる属性を定義します。これは、データ (署名済み)、ハッシュされてから署名されたもの、または署名の隣にある (署名なし) のいずれかです。

投稿された追加の質問には、証明書検証データ (OCSP および CRL) の追加が含まれているようです。

        commonCertificateVerifier.setCrlSource(new OnlineCRLSource());
        commonCertificateVerifier.setOcspSource(new OnlineOCSPSource());
于 2019-07-13T18:35:43.727 に答える