CertPathValidator — 인증 경로 검증자

CertPathValidator — 인증 경로 검증자

인증 경로(인증서 체인)를 검증하는 클래스예요. 이 클래스는 프로바이더 기반 아키텍처를 사용해요. CertPathValidator를 만들려면 정적 getInstance 메서드 중 하나를 호출해 원하는 CertPathValidator의 알고리즘 이름과 선택적으로 원하는 프로바이더 이름을 넘겨요. 생성 후에는 validate 메서드에 검증할 CertPath와 알고리즘 특정 파라미터 집합을 넘겨 인증 경로를 검증할 수 있어요.

출처: Java API Reference

본문

성공하면 결과가 CertPathValidatorResult 인터페이스를 구현하는 객체로 반환돼요. getRevocationChecker() 메서드는 인증서의 폐기 상태를 검사할 때 CertPathValidator가 사용하는 추가 알고리즘 특정 파라미터와 옵션을 지정할 수 있게 해줘요.

Java 플랫폼의 모든 구현은 표준 CertPathValidator 알고리즘인 PKIX를 지원해야 해요. 정적 메서드는 스레드 안전이 보장되지만, non-static 메서드는 그렇지 않아요.

주요 메서드

  • public static CertPathValidator getInstance(String algorithm) throws NoSuchAlgorithmException — 지정된 알고리즘을 구현하는 CertPathValidator 객체를 반환해요.
  • public static CertPathValidator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException — 지정된 알고리즘과 프로바이더의 CertPathValidator 객체를 반환해요.
  • public static CertPathValidator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException — 지정된 알고리즘과 Provider 객체의 CertPathValidator 객체를 반환해요.
  • public final Provider getProvider() — 이 CertPathValidator의 프로바이더를 반환해요.
  • public final String getAlgorithm() — 이 CertPathValidator의 알고리즘 이름을 반환해요.
  • public final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params) throws CertPathValidatorException, InvalidAlgorithmParameterException — 지정된 파라미터로 지정된 인증 경로를 검증해요.
  • public final PKIXRevocationChecker getRevocationChecker() — 폐기 상태를 검사하는 추가 알고리즘 특정 파라미터와 옵션을 지정하는 데 사용하는 폐기 검사기를 반환해요.
CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
PKIXParameters params = ...;
CertPathValidatorResult result = cpv.validate(path, params);

더 알아보기 (Learn more)