Package com.vmware.sso.client.samples
Class AcquireHoKTokenBySolutionCertificateSample
- java.lang.Object
-
- com.vmware.sso.client.samples.AcquireHoKTokenBySolutionCertificateSample
-
public class AcquireHoKTokenBySolutionCertificateSample extends java.lang.ObjectThis 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]
-
-
Constructor Summary
Constructors Constructor Description AcquireHoKTokenBySolutionCertificateSample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.ElementgetToken(java.lang.String ssoUrl, java.security.PrivateKey solPrivateKey, java.security.cert.X509Certificate solCert)static voidmain(java.lang.String[] args)
-
-
-
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 urlsolPrivateKey-PrivateKeyof the solutionsolCert-X509Certificatecertificate 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
-
-