| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.security.keystore2; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.security.KeyStoreSecurityLevel; |
| 21 |
import android.system.keystore2.Authorization; |
| 22 |
import android.system.keystore2.KeyDescriptor; |
| 23 |
|
| 24 |
import java.security.PrivateKey; |
| 25 |
import java.security.interfaces.XECPrivateKey; |
| 26 |
import java.security.spec.NamedParameterSpec; |
| 27 |
import java.util.Optional; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public class AndroidKeyStoreXDHPrivateKey extends AndroidKeyStorePrivateKey |
| 36 |
implements XECPrivateKey { |
| 37 |
public AndroidKeyStoreXDHPrivateKey( |
| 38 |
@NonNull KeyDescriptor descriptor, long keyId, |
| 39 |
@NonNull Authorization[] authorizations, |
| 40 |
@NonNull String algorithm, |
| 41 |
@NonNull KeyStoreSecurityLevel securityLevel) { |
| 42 |
super(descriptor, keyId, authorizations, algorithm, securityLevel); |
| 43 |
} |
| 44 |
|
| 45 |
@Override |
| 46 |
public NamedParameterSpec getParams() { |
| 47 |
return NamedParameterSpec.X25519; |
| 48 |
} |
| 49 |
|
| 50 |
@Override |
| 51 |
public Optional<byte[]> getScalar() { |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
return Optional.empty(); |
| 56 |
} |
| 57 |
} |