use of org.nhindirect.policy.x509.AuthorityInfoAccessOCSPLocExtentionField in project nhin-d by DirectProject.
the class AuthorityInfoAccessOCSPLocExtentionField_injectReferenceValueTest method testInjectRefereneValue_noInjection_getPolicyValue_assertException.
public void testInjectRefereneValue_noInjection_getPolicyValue_assertException() throws Exception {
final AuthorityInfoAccessOCSPLocExtentionField field = new AuthorityInfoAccessOCSPLocExtentionField(true);
boolean exceptionOccured = false;
try {
field.getPolicyValue();
} catch (IllegalStateException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.policy.x509.AuthorityInfoAccessOCSPLocExtentionField in project nhin-d by DirectProject.
the class AuthorityInfoAccessOCSPLocExtentionField_injectReferenceValueTest method testInjectRefereneValue_aiaExists_assertValue.
public void testInjectRefereneValue_aiaExists_assertValue() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("CernerDirectProviderCA.der");
final AuthorityInfoAccessOCSPLocExtentionField field = new AuthorityInfoAccessOCSPLocExtentionField(false);
field.injectReferenceValue(cert);
Collection<String> usages = field.getPolicyValue().getPolicyValue();
assertFalse(field.getPolicyValue().getPolicyValue().isEmpty());
assertTrue(usages.contains("http://ca.cerner.com/OCSP"));
}
use of org.nhindirect.policy.x509.AuthorityInfoAccessOCSPLocExtentionField in project nhin-d by DirectProject.
the class AuthorityInfoAccessOCSPLocExtentionField_injectReferenceValueTest method testInjectRefereneValue_aiaDoesNotExist_notRequired_assertValueEmpty.
public void testInjectRefereneValue_aiaDoesNotExist_notRequired_assertValueEmpty() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("altNameOnly.der");
final AuthorityInfoAccessOCSPLocExtentionField field = new AuthorityInfoAccessOCSPLocExtentionField(false);
field.injectReferenceValue(cert);
assertTrue(field.getPolicyValue().getPolicyValue().isEmpty());
}
use of org.nhindirect.policy.x509.AuthorityInfoAccessOCSPLocExtentionField in project nhin-d by DirectProject.
the class AuthorityInfoAccessOCSPLocExtentionField_injectReferenceValueTest method testInjectRefereneValue_aiaDoesNotExist_required_assertException.
public void testInjectRefereneValue_aiaDoesNotExist_required_assertException() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("altNameOnly.der");
final AuthorityInfoAccessOCSPLocExtentionField field = new AuthorityInfoAccessOCSPLocExtentionField(true);
boolean exceptionOccured = false;
try {
field.injectReferenceValue(cert);
} catch (PolicyRequiredException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations