Package overit.geocall.util
Class SignedMap
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,String>
Map containing methods for generation and verification a shared secret based sign.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidComputes the sign based upon all the values of the map, and generates the sing inside the signKeybooleanComputes the sign based upon all the values of the map except for the signKey and verifiy the it is the same of the signedKeyMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
_signKey
-
-
Constructor Details
-
SignedMap
Creates a SignedMap- Parameters:
signKey- The name of the key whose value hosts the sign
-
-
Method Details
-
sign
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
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:
trueif the sign is the same of the signedKey,falseotherwise
-