KeyInfo Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Information about a key from the Android Keystore system.
[Android.Runtime.Register("android/security/keystore/KeyInfo", ApiSince=23, DoNotGenerateAcw=true)]
public class KeyInfo : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Security.Spec.IKeySpec
[<Android.Runtime.Register("android/security/keystore/KeyInfo", ApiSince=23, DoNotGenerateAcw=true)>]
type KeyInfo = class
inherit Object
interface IKeySpec
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Information about a key from the Android Keystore system. This class describes whether the key material is available in plaintext outside of secure hardware, whether user authentication is required for using the key and whether this requirement is enforced by secure hardware, the key's origin, what uses the key is authorized for (e.g., only in GCM
mode, or signing only), whether the key should be encrypted at rest, the key's and validity start and end dates.
Instances of this class are immutable.
<h3>Example: Symmetric Key</h3> The following example illustrates how to obtain a KeyInfo
describing the provided Android Keystore SecretKey
.
{@code
SecretKey key = ...; // Android Keystore key
SecretKeyFactory factory = SecretKeyFactory.getInstance(key.getAlgorithm(), "AndroidKeyStore");
KeyInfo keyInfo;
try {
keyInfo = (KeyInfo) factory.getKeySpec(key, KeyInfo.class);
} catch (InvalidKeySpecException e) {
// Not an Android KeyStore key.
}}
<h3>Example: Private Key</h3> The following example illustrates how to obtain a KeyInfo
describing the provided Android KeyStore PrivateKey
.
{@code
PrivateKey key = ...; // Android KeyStore key
KeyFactory factory = KeyFactory.getInstance(key.getAlgorithm(), "AndroidKeyStore");
KeyInfo keyInfo;
try {
keyInfo = factory.getKeySpec(key, KeyInfo.class);
} catch (InvalidKeySpecException e) {
// Not an Android KeyStore key.
}}
Java documentation for android.security.keystore.KeyInfo
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Class |
Returns the runtime class of this |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
Is |
Returns |
Is |
Returns |
Is |
Returns |
Is |
Returns |
Is |
Returns |
Is |
Returns |
Is |
Returns |
Jni |
(Inherited from Object) |
Jni |
|
Key |
Gets the size of the key in bits. |
Keystore |
Gets the entry alias under which the key is stored in the |
Key |
Gets the time instant after which the key is no long valid for decryption and verification. |
Key |
Gets the time instant after which the key is no long valid for encryption and signing. |
Key |
Gets the time instant before which the key is not yet valid. |
Peer |
(Inherited from Object) |
Purposes |
Gets the set of purposes (e. |
Remaining |
Returns the remaining number of times the key is allowed to be used or
|
Security |
Returns the security level that the key is protected by. |
Threshold |
|
Threshold |
|
User |
Gets the acceptable user authentication types for which this key can be authorized to be used. |
User |
Gets the duration of time (seconds) for which this key is authorized to be used after the user is successfully authenticated. |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
Get |
Gets the set of block modes (e. |
Get |
Gets the set of digest algorithms (e. |
Get |
Gets the set of padding schemes (e. |
Get |
Returns a hash code value for the object. (Inherited from Object) |
Get |
Gets the set of padding schemes (e. |
Java |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
Notify |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
Set |
Sets the Handle property. (Inherited from Object) |
To |
(Inherited from Object) |
To |
Returns a string representation of the object. (Inherited from Object) |
Unregister |
(Inherited from Object) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
IJava |
(Inherited from Object) |
Java |
Performs an Android runtime-checked type conversion. |
Java |
|
Get |