Loading cadc-cdp/build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ sourceCompatibility = 1.7 group = 'org.opencadc' version = '1.1' version = '1.1.1' mainClassName = 'ca.nrc.cadc.cred.client.Main' Loading cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/CredClient.java +30 −2 Original line number Diff line number Diff line Loading @@ -210,9 +210,37 @@ public class CredClient } /** * Delegate credentials to the service (IVOA CDP-1.0). * Delegate current subject credentials to the service (IVOA CDP-1.0). * * @param userDN * @param days * @throws MalformedURLException * @throws IOException * @throws InvalidKeyException * @throws NoSuchProviderException * @throws NoSuchAlgorithmException * @throws SignatureException * @throws CertificateEncodingException * @throws CertificateParsingException * @throws CertificateExpiredException * @throws CertificateNotYetValidException * @throws ca.nrc.cadc.net.ResourceNotFoundException */ public void delegate(double days) throws MalformedURLException, IOException, InvalidKeyException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, CertificateEncodingException, CertificateParsingException, CertificateExpiredException, CertificateNotYetValidException, ResourceNotFoundException { delegate(null, days); } /** * Custom delegation method that allows the caller to have a different DN from * the created certificate DN. This feature allows the caller/signer to use the * CDP service as a certificate authority (see: cadc-cert-gen). * * @param userDN target DN to create; null for self-delegation * @param days * @throws MalformedURLException * @throws IOException Loading cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/CredUtil.java +9 −1 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import java.security.PrivilegedExceptionAction; import java.security.cert.CertificateException; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateNotYetValidException; import java.util.Iterator; import javax.security.auth.Subject; import org.apache.log4j.Logger; Loading Loading @@ -196,7 +197,14 @@ public class CredUtil } privateKeyChain.getChain()[0].checkValidity(); // carefully remove the previous chain Iterator iter = subject.getPublicCredentials().iterator(); while ( iter.hasNext() ) { Object o = iter.next(); if (o instanceof X509CertificateChain) iter.remove(); } subject.getPublicCredentials().add(privateKeyChain); } } Loading cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/Main.java +4 −4 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ public class Main implements PrivilegedAction<Boolean> { try { client.delegate(null, daysValid); client.delegate(daysValid); msg("Certificate updated"); } catch (Exception e) Loading Loading @@ -425,10 +425,10 @@ public class Main implements PrivilegedAction<Boolean> public static void usage() { String[] um = { "Usage: java -jar cadcCDP.jar [-v|--verbose|-d|--debug] --resourceID=<CDP service to use> <op> ...", "Usage: cadc-cdp [-v|--verbose|-d|--debug] --resourceID=<CDP service to use> <op> ...", CertCmdArgUtil.getCertArgUsage(), "", "Help: java -jar cadcCDP.jar <-h | --help>", "Help: cadc-cdp <-h|--help>", "", " --resourceID specifies the CDP service to use (e.g. ivo://cadc.nrc.ca/cred)", "", Loading @@ -439,7 +439,7 @@ public class Main implements PrivilegedAction<Boolean> " --get --userdn=<user distinguished name> [--out=<file>] [--daysValid=<days>] ", " get a new (shorter) proxy certificate from the server;", " --view", " view the currently deleagted proxy certificate", " view the currently delegated proxy certificate", }; for (String line : um) Loading Loading
cadc-cdp/build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ sourceCompatibility = 1.7 group = 'org.opencadc' version = '1.1' version = '1.1.1' mainClassName = 'ca.nrc.cadc.cred.client.Main' Loading
cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/CredClient.java +30 −2 Original line number Diff line number Diff line Loading @@ -210,9 +210,37 @@ public class CredClient } /** * Delegate credentials to the service (IVOA CDP-1.0). * Delegate current subject credentials to the service (IVOA CDP-1.0). * * @param userDN * @param days * @throws MalformedURLException * @throws IOException * @throws InvalidKeyException * @throws NoSuchProviderException * @throws NoSuchAlgorithmException * @throws SignatureException * @throws CertificateEncodingException * @throws CertificateParsingException * @throws CertificateExpiredException * @throws CertificateNotYetValidException * @throws ca.nrc.cadc.net.ResourceNotFoundException */ public void delegate(double days) throws MalformedURLException, IOException, InvalidKeyException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, CertificateEncodingException, CertificateParsingException, CertificateExpiredException, CertificateNotYetValidException, ResourceNotFoundException { delegate(null, days); } /** * Custom delegation method that allows the caller to have a different DN from * the created certificate DN. This feature allows the caller/signer to use the * CDP service as a certificate authority (see: cadc-cert-gen). * * @param userDN target DN to create; null for self-delegation * @param days * @throws MalformedURLException * @throws IOException Loading
cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/CredUtil.java +9 −1 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import java.security.PrivilegedExceptionAction; import java.security.cert.CertificateException; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateNotYetValidException; import java.util.Iterator; import javax.security.auth.Subject; import org.apache.log4j.Logger; Loading Loading @@ -196,7 +197,14 @@ public class CredUtil } privateKeyChain.getChain()[0].checkValidity(); // carefully remove the previous chain Iterator iter = subject.getPublicCredentials().iterator(); while ( iter.hasNext() ) { Object o = iter.next(); if (o instanceof X509CertificateChain) iter.remove(); } subject.getPublicCredentials().add(privateKeyChain); } } Loading
cadc-cdp/src/main/java/ca/nrc/cadc/cred/client/Main.java +4 −4 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ public class Main implements PrivilegedAction<Boolean> { try { client.delegate(null, daysValid); client.delegate(daysValid); msg("Certificate updated"); } catch (Exception e) Loading Loading @@ -425,10 +425,10 @@ public class Main implements PrivilegedAction<Boolean> public static void usage() { String[] um = { "Usage: java -jar cadcCDP.jar [-v|--verbose|-d|--debug] --resourceID=<CDP service to use> <op> ...", "Usage: cadc-cdp [-v|--verbose|-d|--debug] --resourceID=<CDP service to use> <op> ...", CertCmdArgUtil.getCertArgUsage(), "", "Help: java -jar cadcCDP.jar <-h | --help>", "Help: cadc-cdp <-h|--help>", "", " --resourceID specifies the CDP service to use (e.g. ivo://cadc.nrc.ca/cred)", "", Loading @@ -439,7 +439,7 @@ public class Main implements PrivilegedAction<Boolean> " --get --userdn=<user distinguished name> [--out=<file>] [--daysValid=<days>] ", " get a new (shorter) proxy certificate from the server;", " --view", " view the currently deleagted proxy certificate", " view the currently delegated proxy certificate", }; for (String line : um) Loading