Package com.google.crypto.tink.hybrid
Class EciesParameters
- java.lang.Object
-
- com.google.crypto.tink.Parameters
-
- com.google.crypto.tink.hybrid.HybridParameters
-
- com.google.crypto.tink.hybrid.EciesParameters
-
public final class EciesParameters extends HybridParameters
Parameters for an ECIES primitive with HKDF and AEAD encryption.This API follows loosely ECIES ISO 18033-2 standard (Elliptic Curve Integrated Encryption Scheme, see http://www.shoup.net/iso/std6.pdf), but with some differences:
- use of HKDF key derivation function (instead of KDF1 and KDF2) enabling the use of optional parameters to the key derivation function, which strenghten the overall security and allow for binding the key material to application-specific information (see RFC 5869)
- use of modern AEAD/Deterministic AEAD schemes rather than "manual composition" of symmetric encryption with message authentication codes (as in DEM1, DEM2, and DEM3 schemes of ISO 18033-2)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEciesParameters.BuilderBuilds a newEciesParametersinstance.static classEciesParameters.CurveTypeThe elliptic curve type used for the KEM.static classEciesParameters.HashTypeThe Hash algorithm used for the KEM.static classEciesParameters.PointFormatThe Elliptic Curve Point Format.static classEciesParameters.VariantDescription of the output prefix prepended to the ciphertext.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EciesParameters.Builderbuilder()booleanequals(java.lang.Object o)EciesParameters.CurveTypegetCurveType()ParametersgetDemParameters()EciesParameters.HashTypegetHashType()EciesParameters.PointFormatgetNistCurvePointFormat()BytesgetSalt()Gets the salt value, which defaults to null if not set.EciesParameters.VariantgetVariant()inthashCode()booleanhasIdRequirement()Returns true if a key created with the parameters in this object has to have a certain ID when it is in a keyset.java.lang.StringtoString()
-
-
-
Method Detail
-
builder
public static EciesParameters.Builder builder()
-
getCurveType
public EciesParameters.CurveType getCurveType()
-
getHashType
public EciesParameters.HashType getHashType()
-
getNistCurvePointFormat
@Nullable public EciesParameters.PointFormat getNistCurvePointFormat()
-
getDemParameters
public Parameters getDemParameters()
-
getVariant
public EciesParameters.Variant getVariant()
-
getSalt
@Nullable public Bytes getSalt()
Gets the salt value, which defaults to null if not set.This class does not store an RFC compliant default value and the converion must be done in the implementation (meaning that a null salt must be converted to a string of zeros that is of the length of the hash function output, as per RFC 5869).
-
hasIdRequirement
public boolean hasIdRequirement()
Description copied from class:ParametersReturns true if a key created with the parameters in this object has to have a certain ID when it is in a keyset.In Tink, certain keys change their behavior depending on the key id (for example, an
Aeadobject can prefix the ciphertext with the big endian encoding of the key id). If this is the case, such a key should require a unique id inKey.getIdRequirementOrNull()and return true here.- Specified by:
hasIdRequirementin classParameters
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-