Is an ECPrivateKey stored in transient memory automatically in javacard, or do you have to specify (and how would you do that)?
14:07 12 Jan 2026

When creating an ECPrivateKey as below, where initaliseDomainParameters(ECKey ecKey) sets the elliptic curve parameters:

public KeyPair keyPair = new KeyPair(KeyPair.ALG_EC_FP, KeyBuilder.LENGTH_EC_FP_256);

ECPublicKey pubKey = (ECPublicKey) key.getPublic();
ECPrivateKey privKey = (ECPrivateKey) key.getPrivate();

initaliseDomainParameters(pubKey);
InitaliseDomainParameters(privKey);

key.genKeyPair();

In what type of memory is the private key stored? Is there was way to force it to be stored in transient memory? Is there any reason that doing this would be bad practise?

cryptography applet smartcard javacard elliptic-curve