Package javacard.security
Interface XECKey
-
- All Known Subinterfaces:
XECPrivateKey
,XECPublicKey
public interface XECKey
TheXECKey
interface is the base interface for all EC keys used for named curves with predefined parameters and encoding.Calls to
Key.getType()
on instances implementing this interface will always returnKeyBuilder.TYPE_XEC
. Detailed information about the key parameters can be retrieved by callinggetParams()
.When the encoded form is set, the key is initialized and ready for use.
- Since:
- 3.1
- See Also:
KeyBuilder.buildXECKey(NamedParameterSpec, short, boolean)
,KeyBuilder.TYPE_XEC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description short
getEncoded(byte[] value, short offset)
Copy the encoded key value in the specified buffer and return the offset in the destination buffer that follows the last byte copied.short
getEncodingLength()
Returns the length of the encoded form of the keyNamedParameterSpec
getParams()
Returns the extended key parameters associated with the key when it was created.void
setEncoded(byte[] value, short offset, short length)
Initialize the key using the specified encoded form.
-
-
-
Method Detail
-
getParams
NamedParameterSpec getParams()
Returns the extended key parameters associated with the key when it was created.- Returns:
- the extended key parameter
-
getEncodingLength
short getEncodingLength()
Returns the length of the encoded form of the key- Returns:
- the encoding length
-
getEncoded
short getEncoded(byte[] value, short offset)
Copy the encoded key value in the specified buffer and return the offset in the destination buffer that follows the last byte copied. The data length copied is equal to the value returned bygetEncodingLength()
.- Parameters:
value
- the output buffer where the encoded key should be copiedoffset
- the offset in the output buffer where the key should be copied- Returns:
- offset + length of copied data
- See Also:
getEncodingLength()
-
setEncoded
void setEncoded(byte[] value, short offset, short length) throws CryptoException
Initialize the key using the specified encoded form. Thelength
must be equal to the value returned bygetEncodingLength()
.- Parameters:
value
- the buffer containing the encoded keyoffset
- the offset in the input buffer where the key startslength
- the encoding length- Throws:
CryptoException
- with the following reason codes- CryptoException.ILLEGAL_VALUE: invalid key encoding
-
-