Tabnine Logo
X509CertificateChain
Code IndexAdd Tabnine to your IDE (free)

How to use
X509CertificateChain
in
ca.nrc.cadc.auth

Best Java code snippets using ca.nrc.cadc.auth.X509CertificateChain (Showing top 18 results out of 315)

origin: org.opencadc/cadc-util

public static SSLSocketFactory getSocketFactory(X509CertificateChain chain)
{
  KeyStore ts = null;
  KeyStore ks = null;
  if (chain != null) 
    ks = getKeyStore(chain.getChain(), chain.getPrivateKey());
  return getSocketFactory(ks, ts);
}
origin: org.opencadc/cadc-util

/**
 * Create a subject with the specified certificate chain and private key.
 * This method constructs an X509CertificateChain and then calls
 * getSubject(X509CertificateChain).
 *
 * @param certs a non-null and non-empty certificate chain
 * @param key optional private key
 * @return a Subject
 */
public static Subject getSubject(X509Certificate[] certs, PrivateKey key)
{
  final X509CertificateChain chain = new X509CertificateChain(certs, key);
  return getSubject(chain);
}
origin: org.opencadc/cadc-util

public X509CertificateChain(X509Certificate[] chain, PrivateKey key)
{
  if (chain == null || chain.length == 0)
    throw new IllegalArgumentException("cannot create X509CertificateChain with no certficates");
  this.chain = chain;
  genExpiryDate();
  
  this.key = key;
  initPrincipal();
  this.hashKey = genHashKey(principal);
}
origin: org.opencadc/cadc-vosi

Date end = null;
Principal principal = null;
for (X509Certificate c : chain.getChain())
origin: org.opencadc/cadc-util

chain = new X509CertificateChain(Arrays.asList(ca));
if (chain != null) {
  principals.add(chain.getPrincipal());
origin: org.opencadc/cadc-cdp

X509CertificateChain privateKeyChain = X509CertificateChain.findPrivateKeyChain(
    subject.getPublicCredentials());
    privateKeyChain.getChain()[0].checkValidity();
  privateKeyChain.getChain()[0].checkValidity();
origin: org.opencadc/cadc-util

public static X509CertificateChain findPrivateKeyChain(Set<Object> publicCredentials)
{
  for (Object credential : publicCredentials)
  {
    if (credential instanceof X509CertificateChain)
    {
      X509CertificateChain chain = (X509CertificateChain) credential;
      if (chain.getPrivateKey() != null)
      {
        return chain;
      }
    }
  }
  return null;
}
origin: org.opencadc/cadc-util

public X509CertificateChain(X500Principal principal, PrivateKey privateKey, String csrString) 
{
  this.principal = principal;
  this.csrString = csrString;
  this.key = privateKey;
  this.hashKey = genHashKey(principal);
  this.chain = null;
  this.endEntity = null;
}
origin: org.opencadc/cadc-util

public void setChain(X509Certificate[] chain)
{
  this.chain = chain;
  genExpiryDate();
}
origin: org.opencadc/cadc-cdp

private X509Certificate[] createProxyCertChain(X509Certificate cert)
{
  AccessControlContext ac = AccessController.getContext();
  Subject subject = Subject.getSubject(ac);
  if (subject != null)
  {
    Set<X509CertificateChain> cc = subject.getPublicCredentials(X509CertificateChain.class);
    if (cc.size() > 0)
    {
      X509CertificateChain xcc = cc.iterator().next();
      X509Certificate[] chain = xcc.getChain();
      X509Certificate[] ret = new X509Certificate[chain.length + 1];
      ret[0] = cert;
      for (int i=0; i<chain.length; i++)
      {
        ret[i+1] = chain[i];
      }
      return ret;
    }
  }
  throw new IllegalStateException("current Subject does not contain a certficate chain");
  
}
origin: org.opencadc/cadc-auth-restlet

        "org.restlet.https.clientCertificates");
if ((requestCertificates != null) && (!requestCertificates.isEmpty())) {
  this.chain = new X509CertificateChain(requestCertificates);
  principals.add(this.chain.getPrincipal());
origin: org.opencadc/cadc-cdp

  /**
   * @param chain certificate
   * @param writer writer use to write the generated PEM certificate
   * @throws IOException
   */
  public static void writePEMCertificateAndKey(
      X509CertificateChain chain, Writer writer)
      throws IOException
  {
    if (chain == null)
      throw new IllegalArgumentException("Null certificate chain");
    if (writer == null)
      throw new IllegalArgumentException("Null writer");

    PEMWriter pemWriter = new PEMWriter(writer);
    // write the first certificate first
    pemWriter.writeObject(chain.getChain()[0]);
    // then the key
    pemWriter.writeObject(chain.getPrivateKey());
    // and finally the rest of the certificates in the chain
    for (int i = 1; i < chain.getChain().length; i++)
    {
      pemWriter.writeObject(chain.getChain()[i]);
    }        
    pemWriter.flush();
  }
}
origin: org.opencadc/cadc-util

for (X509Certificate c : chain.getChain())
origin: org.opencadc/cadc-util

public X509CertificateChain(Collection<X509Certificate> certs)
{
  if (certs == null || certs.isEmpty())
    throw new IllegalArgumentException("cannot create X509CertificateChain with no certficates");
  this.chain = certs.toArray(new X509Certificate[certs.size()]);
  genExpiryDate();
  
  initPrincipal();
  this.hashKey = genHashKey(principal);
}
origin: org.opencadc/cadc-util

X509Certificate[] chain = readCertificateChain(certificates);
return new X509CertificateChain(chain, pk);
origin: org.opencadc/cadc-cdp

  CertificateNotYetValidException
X509Certificate issuerCert = chain.getChain()[0];
PrivateKey issuerKey = chain.getPrivateKey();
for (X509Certificate currentCert : chain.getChain())
  for (X509Certificate currentCert : chain.getChain())
  for (X509Certificate currentCert : chain.getChain())
origin: org.opencadc/cadc-util

Date start = null;
Date end = null;
for (X509Certificate c : chain.getChain())
origin: org.opencadc/cadc-vos

for (X509Certificate c : chain.getChain())
ca.nrc.cadc.authX509CertificateChain

Javadoc

Class to store an X509Certificate chain.

Most used methods

  • getChain
  • <init>
  • getPrincipal
  • getPrivateKey
  • findPrivateKeyChain
  • genExpiryDate
  • genHashKey
  • getKey
  • getX500Principal
  • initPrincipal

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Reference (javax.naming)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now