@Test public void testGetSigningPolicy() throws Exception { SigningPolicyParser parser = new SigningPolicyParser(); Map<X500Principal, SigningPolicy> policies; policies = parser.parse(new InputStreamReader(new GlobusPathMatchingResourcePatternResolver().getResource("classpath:/org/globus/gsi/test/49f18420.signing_policy").getInputStream())); assertNotNull(policies); assertFalse(policies.isEmpty()); SimpleMemorySigningPolicyStore store = new SimpleMemorySigningPolicyStore(policies.values().toArray(new SigningPolicy[1])); for (X500Principal p : policies.keySet()) { assertNotNull(store.getSigningPolicy(p)); } }
public SigningPolicy getSigningPolicy(X500Principal caPrincipal) throws SigningPolicyStoreException { SigningPolicy policy = store.get(caPrincipal.getName(X500Principal.RFC2253)); if (policy == null) { X509Name name = new X509Name(false, caPrincipal.getName(X500Principal.RFC2253)); logger.debug("Getting from policy store: " + X509NameHelper.toString(name)); policy = store.get(X509NameHelper.toString(name)); } return policy; }
SimpleMemorySigningPolicyStore implements SigningPolicyStore { public SigningPolicy getSigningPolicy(X500Principal caPrincipal) throws SigningPolicyStoreException { SigningPolicy policy = store.get(caPrincipal.getName(X500Principal.RFC2253)); if (policy == null) { X509Name name = new X509Name(false, caPrincipal.getName(X500Principal.RFC2253)); logger.debug("Getting from policy store: " + X509NameHelper.toString(name)); policy = store.get(X509NameHelper.toString(name)); } return policy; } }
SimpleMemorySigningPolicyStore implements SigningPolicyStore { public SigningPolicy getSigningPolicy(X500Principal caPrincipal) throws SigningPolicyStoreException { SigningPolicy policy = store.get(caPrincipal.getName(X500Principal.RFC2253)); if (policy == null) { X509Name name = new X509Name(false, caPrincipal.getName(X500Principal.RFC2253)); logger.debug("Getting from policy store: " + X509NameHelper.toString(name)); policy = store.get(X509NameHelper.toString(name)); } return policy; } SimpleMemorySigningPolicyStore(SigningPolicy[] policies); }
SimpleMemorySigningPolicyStore implements SigningPolicyStore { public SigningPolicy getSigningPolicy(X500Principal caPrincipal) throws SigningPolicyStoreException { SigningPolicy policy = store.get(caPrincipal.getName(X500Principal.RFC2253)); if (policy == null) { X509Name name = new X509Name(false, caPrincipal.getName(X500Principal.RFC2253)); logger.debug("Getting from policy store: " + X509NameHelper.toString(name)); policy = store.get(X509NameHelper.toString(name)); } return policy; } SimpleMemorySigningPolicyStore(SigningPolicy[] policies); SigningPolicy getSigningPolicy(X500Principal caPrincipal); }
SimpleMemorySigningPolicyStore implements SigningPolicyStore { public SigningPolicy getSigningPolicy(X500Principal caPrincipal) throws SigningPolicyStoreException { SigningPolicy policy = store.get(caPrincipal.getName(X500Principal.RFC2253)); if (policy == null) { X509Name name = new X509Name(false, caPrincipal.getName(X500Principal.RFC2253)); logger.debug("Getting from policy store: " + X509NameHelper.toString(name)); policy = store.get(X509NameHelper.toString(name)); } return policy; } SimpleMemorySigningPolicyStore(SigningPolicy[] policies); SigningPolicy getSigningPolicy(X500Principal caPrincipal);  }