Class TppTokenConnector
- java.lang.Object
-
- com.venafi.vcert.sdk.connectors.tpp.AbstractTppConnector
-
- com.venafi.vcert.sdk.connectors.tpp.TppTokenConnector
-
- All Implemented Interfaces:
TokenConnector
public class TppTokenConnector extends AbstractTppConnector implements TokenConnector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.venafi.vcert.sdk.connectors.tpp.AbstractTppConnector
AbstractTppConnector.AuthorizeRequest, AbstractTppConnector.CertificateRenewalRequest, AbstractTppConnector.CertificateRequestsPayload, AbstractTppConnector.CertificateRetrieveRequest, AbstractTppConnector.CertificateRevokeRequest, AbstractTppConnector.NameValuePair<K,V>, AbstractTppConnector.ReadZoneConfigurationRequest, AbstractTppConnector.ReadZoneConfigurationResponse, AbstractTppConnector.SANItem
-
-
Field Summary
-
Fields inherited from class com.venafi.vcert.sdk.connectors.tpp.AbstractTppConnector
FAILED_TO_AUTHENTICATE_MESSAGE, HEADER_VALUE_AUTHORIZATION, MISSING_ACCESS_TOKEN_MESSAGE, MISSING_CREDENTIALS_MESSAGE, MISSING_REFRESH_TOKEN_MESSAGE, revocationReasons, tpp, TPP_ATTRIBUTE_MANAGEMENT_TYPE, TPP_ATTRIBUTE_MANUAL_CSR, vendorAndProductName, zone
-
-
Constructor Summary
Constructors Constructor Description TppTokenConnector(Tpp tpp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateRequestgenerateRequest(ZoneConfiguration config, CertificateRequest request)VedAuth method.TokenInfogetAccessToken()returns a new access token.TokenInfogetAccessToken(Authentication auth)returns a new access token.PolicySpecificationgetPolicy(String policyName)Returns the policySpecification from the policy which matches with the policyName argument.protected TppAPIgetTppAPI()ConnectorTypegetType()StringgetVendorAndProductName()ImportResponseimportCertificate(ImportRequest request)VedAuth method.voidping()VedAuth method.PolicyreadPolicyConfiguration(String zone)VedAuth method.ZoneConfigurationreadZoneConfiguration(String zone)VedAuth method.TokenInforefreshAccessToken(String clientId)this is for refreshing a token.StringrenewCertificate(RenewalRequest request)VedAuth method.StringrequestCertificate(CertificateRequest request, ZoneConfiguration zoneConfiguration)VedAuth method.StringrequestCertificate(CertificateRequest request, String zone)VedAuth method.StringrequestSshCertificate(SshCertificateRequest sshCertificateRequest)Request a new SSH Certificate.PEMCollectionretrieveCertificate(CertificateRequest request)VedAuth method.SshCertRetrieveDetailsretrieveSshCertificate(SshCertificateRequest sshCertificateRequest)Retrieve a requested SSH CertificateSshConfigretrieveSshConfig(SshCaTemplateRequest sshCaTemplateRequest)Retrieve theSshConfigof the CA specified in theSshCaTemplateRequest.intrevokeAccessToken()voidrevokeCertificate(RevocationRequest request)VedAuth method.voidsetBaseUrl(String url)Allows overriding the default URL used to communicate with VenafivoidsetPolicy(String policyName, PolicySpecification policySpecification)Create/update a policy based on the policySpecification passed as argument.voidsetVendorAndProductName(String vendorAndProductName)Set the vendor and product namevoidsetZone(String zone)Set the default zone-
Methods inherited from class com.venafi.vcert.sdk.connectors.tpp.AbstractTppConnector
getTPPPolicy, requestTppSshCertificate, retrieveTppSshCertificate, retrieveTppSshConfig, setPolicy
-
-
-
-
Constructor Detail
-
TppTokenConnector
public TppTokenConnector(Tpp tpp)
-
-
Method Detail
-
getType
public ConnectorType getType()
- Specified by:
getTypein interfaceTokenConnector- Returns:
- ConnectorType the type of connector Cloud or TPP
-
setBaseUrl
public void setBaseUrl(String url) throws VCertException
Description copied from interface:TokenConnectorAllows overriding the default URL used to communicate with Venafi- Specified by:
setBaseUrlin interfaceTokenConnector- Throws:
VCertException
-
setZone
public void setZone(String zone)
Description copied from interface:TokenConnectorSet the default zone- Specified by:
setZonein interfaceTokenConnector
-
setVendorAndProductName
public void setVendorAndProductName(String vendorAndProductName)
Description copied from interface:TokenConnectorSet the vendor and product name- Specified by:
setVendorAndProductNamein interfaceTokenConnector
-
getVendorAndProductName
public String getVendorAndProductName()
- Specified by:
getVendorAndProductNamein interfaceTokenConnector- Returns:
- the vendor and product name
-
ping
public void ping() throws VCertExceptionDescription copied from interface:TokenConnectorVedAuth method. Attempt to connect the Venafi API and returns an error if it cannot- Specified by:
pingin interfaceTokenConnector- Throws:
VCertException
-
getAccessToken
public TokenInfo getAccessToken(Authentication auth) throws VCertException
Description copied from interface:TokenConnectorreturns a new access token.- Specified by:
getAccessTokenin interfaceTokenConnector- Parameters:
auth- authentication info- Returns:
- the new token.
- Throws:
VCertException- throws this exception when authentication info is null.
-
getAccessToken
public TokenInfo getAccessToken() throws VCertException
Description copied from interface:TokenConnectorreturns a new access token. This method uses theAuthenticationobject passed earlier with theConfigobject.- Specified by:
getAccessTokenin interfaceTokenConnector- Returns:
- the new token.
- Throws:
VCertException- throws this exception when authentication info is null.
-
refreshAccessToken
public TokenInfo refreshAccessToken(String clientId) throws VCertException
Description copied from interface:TokenConnectorthis is for refreshing a token.- Specified by:
refreshAccessTokenin interfaceTokenConnector- Parameters:
clientId- the application id.- Returns:
- a complete info about the new access token, refresh token, expires.
- Throws:
VCertException
-
revokeAccessToken
public int revokeAccessToken() throws VCertException- Specified by:
revokeAccessTokenin interfaceTokenConnector- Returns:
- 1 if the access token was revoked and 0 if not.
- Throws:
VCertException
-
readZoneConfiguration
public ZoneConfiguration readZoneConfiguration(String zone) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Reads the zone configuration needed for generating and requesting a certificate- Specified by:
readZoneConfigurationin interfaceTokenConnector- Parameters:
zone- ID (e.g. 2ebd4ec1-57f7-4994-8651-e396b286a3a8) or zone path (e.g. "ProjectName\ZoneName")- Returns:
- Throws:
VCertException
-
generateRequest
public CertificateRequest generateRequest(ZoneConfiguration config, CertificateRequest request) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. GenerateRequest creates a new certificate request, based on the zone/policy configuration and the user data- Specified by:
generateRequestin interfaceTokenConnector- Returns:
- the zone configuration
- Throws:
VCertException
-
requestCertificate
public String requestCertificate(CertificateRequest request, String zone) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Submits the CSR to Venafi for processing- Specified by:
requestCertificatein interfaceTokenConnector- Returns:
- request id to track the certificate status.
- Throws:
VCertException
-
requestCertificate
public String requestCertificate(CertificateRequest request, ZoneConfiguration zoneConfiguration) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Submits the CSR to Venafi for processing- Specified by:
requestCertificatein interfaceTokenConnector- Returns:
- request id to track the certificate status.
- Throws:
VCertException
-
retrieveCertificate
public PEMCollection retrieveCertificate(CertificateRequest request) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Retrieves the certificate for the specific ID- Specified by:
retrieveCertificatein interfaceTokenConnector- Returns:
- A collection of PEM files including certificate, chain and potentially a private key.
- Throws:
VCertException
-
revokeCertificate
public void revokeCertificate(RevocationRequest request) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Attempts to revoke a certificate- Specified by:
revokeCertificatein interfaceTokenConnector- Throws:
VCertException
-
renewCertificate
public String renewCertificate(RenewalRequest request) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Attempts to renew a certificate- Specified by:
renewCertificatein interfaceTokenConnector- Returns:
- Throws:
VCertException
-
importCertificate
public ImportResponse importCertificate(ImportRequest request) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Import an external certificate into Venafi.- Specified by:
importCertificatein interfaceTokenConnector- Returns:
- Throws:
VCertException
-
readPolicyConfiguration
public Policy readPolicyConfiguration(String zone) throws VCertException
Description copied from interface:TokenConnectorVedAuth method. Reads the policy configuration for a specific zone in Venafi- Specified by:
readPolicyConfigurationin interfaceTokenConnector- Returns:
- Throws:
VCertException
-
setPolicy
public void setPolicy(String policyName, PolicySpecification policySpecification) throws VCertException
Description copied from interface:TokenConnectorCreate/update a policy based on the policySpecification passed as argument.- Specified by:
setPolicyin interfaceTokenConnector- Throws:
VCertException
-
getPolicy
public PolicySpecification getPolicy(String policyName) throws VCertException
Description copied from interface:TokenConnectorReturns the policySpecification from the policy which matches with the policyName argument.- Specified by:
getPolicyin interfaceTokenConnector- Returns:
- Throws:
VCertException
-
requestSshCertificate
public String requestSshCertificate(SshCertificateRequest sshCertificateRequest) throws VCertException
Description copied from interface:TokenConnectorRequest a new SSH Certificate.- Specified by:
requestSshCertificatein interfaceTokenConnector- Parameters:
sshCertificateRequest- TheSshCertificateRequestinstance needed to do the request. For more information about of which properties should be filled, please review the documentation ofSshCertificateRequest.- Returns:
- The DN of the created SSH certificate object. It can be used as pickup ID to retrieve the created SSH Certificate.
For more details review the
retrieveSshCertificate(SshCertificateRequest)method. - Throws:
VCertException
-
retrieveSshCertificate
public SshCertRetrieveDetails retrieveSshCertificate(SshCertificateRequest sshCertificateRequest) throws VCertException
Description copied from interface:TokenConnectorRetrieve a requested SSH Certificate- Specified by:
retrieveSshCertificatein interfaceTokenConnector- Parameters:
sshCertificateRequest- TheSshCertificateRequestinstance needed to do the request.
It's mandatory to set the PickUpID which is the value of the DN returned when the SSH Certificate was requested. For more information about of which properties should be filled, please review the documentation ofSshCertificateRequest.- Returns:
- A
SshCertRetrieveDetailscontaining the Certificate Data of the created Certificate. - Throws:
VCertException
-
retrieveSshConfig
public SshConfig retrieveSshConfig(SshCaTemplateRequest sshCaTemplateRequest) throws VCertException
Description copied from interface:TokenConnectorRetrieve theSshConfigof the CA specified in theSshCaTemplateRequest.- Specified by:
retrieveSshConfigin interfaceTokenConnector- Returns:
- A
SshConfig. - Throws:
VCertException
-
getTppAPI
protected TppAPI getTppAPI()
- Specified by:
getTppAPIin classAbstractTppConnector
-
-