# Class X509CertificateChain

java.lang.Object
uk.ac.starlink.auth.ssl.X509CertificateChain

public class X509CertificateChain extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CERT_BEGIN`
`static final String`
`CERT_END`
`static final String`
`NEW_LINE`
`static final String`
`PRIVATE_KEY_BEGIN`
`static final String`
`PRIVATE_KEY_END`

## Constructor Summary

Constructors
Constructor
Description
`X509CertificateChain(X509Certificate[] chain, PrivateKey key)`
`X509CertificateChain(Collection<X509Certificate> certs)`
`X509CertificateChain(X500Principal principal, PrivateKey privateKey, String csrString)`

## Method Summary

Modifier and Type
Method
Description
`String`
`certificateString()`
`static X509CertificateChain`
`findPrivateKeyChain(Set<Object> publicCredentials)`
`static String`
`genHashKey(X500Principal dn)`
`X509Certificate[]`
`getChain()`
`String`
`getCsrString()`
`X509Certificate`
`getEndEntity()`
`Date`
`getExpiryDate()`
`String`
`getHashKey()`
`PrivateKey`
`getKey()`
`X500Principal`
`getPrincipal()`
`PrivateKey`
`getPrivateKey()`
`X500Principal`
`getX500Principal()`
`boolean`
`isProxy()`
`void`
`setChain(X509Certificate[] chain)`
`void`
`setCsrString(String csrString)`
`void`
`setExpiryDate(Date expiryDate)`
`void`
`setHashKey(String hashKey)`
`void`
`setKey(PrivateKey key)`
`void`
`setPrincipal(X500Principal principal)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### CERT_BEGIN

public static final String CERT_BEGIN

See Also:
  - Constant Field Values

### CERT_END

public static final String CERT_END

See Also:
  - Constant Field Values

### PRIVATE_KEY_BEGIN

public static final String PRIVATE_KEY_BEGIN

See Also:
  - Constant Field Values

### PRIVATE_KEY_END

public static final String PRIVATE_KEY_END

See Also:
  - Constant Field Values

### NEW_LINE

public static final String NEW_LINE

## Constructor Details

### X509CertificateChain

public X509CertificateChain(X500Principal principal, PrivateKey privateKey, String csrString)

### X509CertificateChain

public X509CertificateChain(Collection<X509Certificate> certs)

### X509CertificateChain

public X509CertificateChain(X509Certificate[] chain, PrivateKey key)

## Method Details

### findPrivateKeyChain

public static X509CertificateChain findPrivateKeyChain(Set<Object> publicCredentials)

### certificateString

public String certificateString()

### genHashKey

public static String genHashKey(X500Principal dn)

Parameters:
  `dn` - DN to generate the hash key
Returns:
  hash code corresponding to the CADC canonized version of the DN

### setExpiryDate

public void setExpiryDate(Date expiryDate)

Parameters:
  `expiryDate` - the expiryDate to set

### getExpiryDate

public Date getExpiryDate()

Returns:
  the expiryDate

### setCsrString

public void setCsrString(String csrString)

Parameters:
  `csrString` - the csrString to set

### getCsrString

public String getCsrString()

Returns:
  the csrString

### getPrincipal

public X500Principal getPrincipal()

### setPrincipal

public void setPrincipal(X500Principal principal)

### getKey

public PrivateKey getKey()

### setKey

public void setKey(PrivateKey key)

### setChain

public void setChain(X509Certificate[] chain)

### setHashKey

public void setHashKey(String hashKey)

Parameters:
  `hashKey` - the hashKey to set

### getHashKey

public String getHashKey()

Returns:
  the hashKey

### getX500Principal

public X500Principal getX500Principal()

### getChain

public X509Certificate[] getChain()

### getPrivateKey

public PrivateKey getPrivateKey()

### isProxy

public boolean isProxy()

### getEndEntity

public X509Certificate getEndEntity()