Class SignedMap

All Implemented Interfaces:
Serializable, Cloneable, Map<String,String>

public class SignedMap extends HashMap<String,String>
Map containing methods for generation and verification a shared secret based sign.
See Also:
  • Field Details

    • _signKey

      protected String _signKey
  • Constructor Details

    • SignedMap

      public SignedMap(String signKey)
      Creates a SignedMap
      Parameters:
      signKey - The name of the key whose value hosts the sign
  • Method Details

    • sign

      public void sign(String secret)
      Computes the sign based upon all the values of the map, and generates the sing inside the signKey
      Parameters:
      secret - The name of the shared secret that must be known to verify the validity of the map
    • verify

      public boolean verify(String secret)
      Computes the sign based upon all the values of the map except for the signKey and verifiy the it is the same of the signedKey
      Parameters:
      secret - The name of the shared secret that must be known to verify the validity of the map
      Returns:
      true if the sign is the same of the signedKey, false otherwise