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