Class AcquireHoKTokenBySolutionCertificateSample


  • public class AcquireHoKTokenBySolutionCertificateSample
    extends java.lang.Object
    This sample illustrates acquiring a Holder-Of-Key token from SSO server by using the registered solution's private key and certificate for example vCenter server. Note that when using the key from a vCenter Server you will need to convert the key's format to PKCS8 for it to be used in this samples. For this the open source "openssl" tool can be leveraged for converting the private key into the PKCS8 format by using the following command:
     openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key_file -nocrypt > pkcs8_key
     
      Usage:
     To load the key/certificate pair from individual files use:
       run.bat com.vmware.sso.client.samples.AcquireHoKTokenBySolutionCertificateSample [sso url] [path to key file] [path to certificate file]
     ****OR*****
     To load the key/certificate pair from a keystore use:
       run.bat com.vmware.sso.client.samples.AcquireHoKTokenBySolutionCertificateSample [sso url] [path to keystore file] [keystore password] [alias used in keystore]
     
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.w3c.dom.Element getToken​(java.lang.String ssoUrl, java.security.PrivateKey solPrivateKey, java.security.cert.X509Certificate solCert)  
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AcquireHoKTokenBySolutionCertificateSample

        public AcquireHoKTokenBySolutionCertificateSample()
    • Method Detail

      • getToken

        public static org.w3c.dom.Element getToken​(java.lang.String ssoUrl,
                                                   java.security.PrivateKey solPrivateKey,
                                                   java.security.cert.X509Certificate solCert)
                                            throws javax.xml.datatype.DatatypeConfigurationException
        Parameters:
        ssoUrl - SSO server url
        solPrivateKey - PrivateKey of the solution
        solCert - X509Certificate certificate of the solution
        Returns:
        A new Holder-Of-Key token
        Throws:
        javax.xml.datatype.DatatypeConfigurationException
      • main

        public static void main​(java.lang.String[] args)
                         throws javax.xml.datatype.DatatypeConfigurationException
        Throws:
        javax.xml.datatype.DatatypeConfigurationException