2

암호화 및 보안에 대한 새로운 내용이며 x509 인증서를 처음 봅니다. 해지 상태 BouncyCastle에서 X.509 인증서를 생성 할 때 알 수없는 오류가 발생했습니다.

는 BouncyCastle API를 사용하는 다음 코드를 시도 :

X509V3CertificateGenerator certGenerator = new X509V3CertificateGenerator(); 
System.out.println("- ---Inside createCertificate Method----- certificate generated"); 
certGenerator.setSerialNumber(BigInteger.valueOf(Math.abs(new Random().nextLong()))); 
certGenerator.setIssuerDN(new X509Name(dn)); 
certGenerator.setSubjectDN(new X509Name(dn)); 
certGenerator.setIssuerDN(new X509Name(issuer)); // Set issuer! 
Calendar instance = Calendar.getInstance(); 
X509Certificate certificate = (X509Certificate) certGenerator.generate(
        privateKey, "BC"); 

을 그리고 예외로 실행합니다.

security: The OCSP support is enabled 
security: The CRL support is enabled 
security: Failing over to CRLs: Certificate does not specify OCSP responder 
security: Revocation Status Unknown 
com.sun.deploy.security.RevocationChecker$StatusUnknownException: Certificate does not specify OCSP responder 
    at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source) 
    at com.sun.deploy.security.RevocationChecker.check(Unknown Source) 
    at com.sun.deploy.security.TrustDecider.checkRevocationStatus(Unknown Source) 
    at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source) 
    at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source) 
    at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source) 
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source) 
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source) 
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) 
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) 
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.lang.Class.getDeclaredConstructors0(Native Method) 
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) 
    at java.lang.Class.getConstructor0(Unknown Source) 
    at java.lang.Class.newInstance(Unknown Source) 
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) 
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) 
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) 
    at java.awt.EventQueue.access$200(Unknown Source) 
    at java.awt.EventQueue$3.run(Unknown Source) 
    at java.awt.EventQueue$3.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.awt.EventQueue$4.run(Unknown Source) 
    at java.awt.EventQueue$4.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.awt.EventQueue.dispatchEvent(Unknown Source) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    at java.awt.EventDispatchThread.run(Unknown Source) 
    Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException 
     at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source) 
     ... 54 more 
network: Created version ID: 1.7.0.51 
network: Created version ID: 1.7.0.51 

Google에 시도했지만 이것에 대한 단서는 없습니다. 어떤 도움을 주셔서 감사합니다.

답변

0

문제는 BouncyCastle 및 인증서 생성과 관련이 없습니다. Java 애플릿을 사용 중이고 Java 플러그인이 JAR 파일 특성의 유효성을 검증하려고합니다. 그러나 서명 인증서 (또는 인증서 체인의 인증서 중 하나)에 CRL 서버 또는 OCSP 응답자 URL을 포함하는 적절한 확장이없는 것으로 보입니다. 따라서 서명 유효성 검사가 실패하고 JAR을 사용할 수 없습니다.

Java Control Center (고급 탭의 "인증서 해지 확인 수행"옵션에서 유효성 검사 없음 선택)에서 인증서 유효성 검사를 비활성화 할 수 있습니다. 이 값은 권장되지 않음이지만 일상적인 사용에는 적합하지만 테스트 용으로 허용됩니다 (예 : 애플릿이 개발/자체 서명 인증서로 서명 된 개발 중).

+0

Java.com에서 Java 버전 검사기를 실행하는 것과 동일한 문제점을 발견했습니다. 'https : // www.java.com/ko/download/installed.jsp' http://java.com:8080. 그것은 자바가 인증서 나 항아리를 발행하는 것을 망쳤다는 의미입니까? –