Class UakAuthenticator

java.lang.Object
com.veertu.ankaMgmtSdk.UakAuthenticator

public class UakAuthenticator extends Object
  • Constructor Details

    • UakAuthenticator

      public UakAuthenticator(List<String> mgmtURLs, boolean skipTLSVerification, String rootCA, String id, String pemKey)
      Initializes a new instance of the UakAuthenticator class.
      Parameters:
      mgmtURLs - the Anka Management API URLs
      skipTLSVerification - whether to skip TLS verification
      rootCA - the root CA certificate in PEM format
      id - the UAK ID
      pemKey - the RSA private key in PEM format
  • Method Details

    • getRSAPrivateKey

      public static org.bouncycastle.asn1.pkcs.RSAPrivateKey getRSAPrivateKey(String key)
      Parses a UAK credential string and returns the RSA private key. UAK can be either a PEM formatted private key or just a concatenated string without header and footer.
      Parameters:
      key - the key string to parse
      Returns:
      the RSA private key object
      Throws:
      IllegalArgumentException - if the key is null, empty, or not a valid RSA private key
    • getAuthorization

      public org.apache.http.NameValuePair getAuthorization() throws AnkaMgmtException, ClientException
      Gets the Authorization header for the Anka Management API.
      Returns:
      the Authorization header
      Throws:
      AnkaMgmtException - if the request fails
      ClientException - if the request fails