Class HeaderMetaParser

java.lang.Object
co.ankatech.ankasecure.sdk.meta.HeaderMetaParser

public final class HeaderMetaParser extends Object
Utility class that converts the Crypto-Policy-Info response header emitted by all streaming endpoints into the immutable SDK metadata objects required by client code.

The header is optional: if it is absent or malformed an empty CryptoPolicyInfo instance is supplied, so callers always receive a valid SingleKeyMeta / DualKeyMeta. Absence of metadata therefore never breaks functional flows – the warning and algorithm fields are simply null.

  • Method Summary

    Modifier and Type
    Method
    Description
    static co.ankatech.ankasecure.openapi.client.DualKeyMeta
    toDualMeta(okhttp3.Headers headers)
    Converts response headers from a dual-key streaming operation (re-encrypt, re-sign) into a DualKeyMeta.
    static co.ankatech.ankasecure.openapi.client.SingleKeyMeta
    toSingleMeta(okhttp3.Headers headers)
    Converts response headers from a single-key streaming operation (encrypt, decrypt, sign, verify) into a SingleKeyMeta.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • toSingleMeta

      public static co.ankatech.ankasecure.openapi.client.SingleKeyMeta toSingleMeta(okhttp3.Headers headers)
      Converts response headers from a single-key streaming operation (encrypt, decrypt, sign, verify) into a SingleKeyMeta.

      If Crypto-Policy-Info is missing or unparsable all optional metadata fields are null.

      Parameters:
      headers - complete HTTP response headers
      Returns:
      immutable metadata describing the operational context
    • toDualMeta

      public static co.ankatech.ankasecure.openapi.client.DualKeyMeta toDualMeta(okhttp3.Headers headers)
      Converts response headers from a dual-key streaming operation (re-encrypt, re-sign) into a DualKeyMeta.

      If Crypto-Policy-Info is missing or unparsable all optional metadata fields are null.

      Parameters:
      headers - complete HTTP response headers
      Returns:
      immutable metadata describing both keys involved