eu.xtreemos.xati.API
Class XRCAClient

java.lang.Object
  extended by eu.xtreemos.xati.API.XRCAClient

public class XRCAClient
extends java.lang.Object

Author:
gregor.pipan@xlab.si

Field Summary
static java.lang.String servicename
           
 
Constructor Summary
XRCAClient()
           
 
Method Summary
static java.lang.Integer applyForRegistration()
          Obtain or reuse own resource details, and send them to RCA derver for resource registration application.
static java.lang.Boolean createDummyCertificate(ResourceID __dummyResId, java.lang.String __outputPath)
           
static RCASignedResponse getMachineAttributeCertificate(java.lang.String __vo)
          Retrieve the machine's attribute certificate.
static java.lang.String getMachineCertificateDetails()
          Opens the certificate currently stored locally and signed by RCA, and returns a string containing the details on the certificate.
static java.security.cert.X509Certificate getMachineIdentityCertificate()
          Retrieve the node's machine identity certificate.
static java.lang.Boolean requestAttributeCertificate(java.lang.String __vo)
          Requests the resource's attribute certificate providing credentials for the given VO from the RCA server.
static java.lang.Boolean requestNewCertificate()
          The method generates a new public and private key pair, then sends the public key for certification to the RCA server and obtains the signed attribute certificate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servicename

public static java.lang.String servicename
Constructor Detail

XRCAClient

public XRCAClient()
Method Detail

getMachineCertificateDetails

public static java.lang.String getMachineCertificateDetails()
                                                     throws java.lang.Exception
Opens the certificate currently stored locally and signed by RCA, and returns a string containing the details on the certificate.

Returns:
The details on the currently stored and used certificate.
Throws:
java.lang.Exception - Thrown when the certificate reading produces an error, or the certificate files are in an invalid format.

getMachineIdentityCertificate

public static java.security.cert.X509Certificate getMachineIdentityCertificate()
                                                                        throws java.lang.Exception
Retrieve the node's machine identity certificate.

Returns:
The certificate currently stored on the node and used by the machine to represent its identity.
Throws:
java.lang.Exception

getMachineAttributeCertificate

public static RCASignedResponse getMachineAttributeCertificate(java.lang.String __vo)
                                                        throws java.lang.Exception
Retrieve the machine's attribute certificate. The caller can select whether the attribute certificate to be retrieved is a general (non-VO) attribute certificate, or an attribute certificate related to the VO.

Parameters:
vo - The ID of the VO the call is to retrieve the attribute certificate of. Use null or an empty string to obtain the non-VO certificate.
Returns:
The storage of attribute certificates. It contains only one of the attribute certificates, depending on which one is currently installed on the node. If both types are installed, then the method selects the one that expires later. Returns null if the certificate is not available.
Throws:
java.lang.Exception

requestNewCertificate

public static java.lang.Boolean requestNewCertificate()
                                               throws java.lang.Exception
The method generates a new public and private key pair, then sends the public key for certification to the RCA server and obtains the signed attribute certificate. It stores the certificates into the local truststore.

Returns:
True if the request was successful, or false otherwise.
Throws:
java.lang.Exception

createDummyCertificate

public static java.lang.Boolean createDummyCertificate(ResourceID __dummyResId,
                                                       java.lang.String __outputPath)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

requestAttributeCertificate

public static java.lang.Boolean requestAttributeCertificate(java.lang.String __vo)
                                                     throws java.lang.Exception
Requests the resource's attribute certificate providing credentials for the given VO from the RCA server. It also installs the new certificate if the request succeeds.

Parameters:
vo - The VO to request the machine's attribute certificate for.
Returns:
True if the request succeeded by obtaining the certificate from the RCA server, and installing it.
Throws:
java.lang.Exception

applyForRegistration

public static java.lang.Integer applyForRegistration()
                                              throws java.lang.Exception
Obtain or reuse own resource details, and send them to RCA derver for resource registration application.

Returns:
0 if the call was successful.
Throws:
java.lang.Exception