Android DeviceCertificate
Device Certificate is used to recognize a valid device.
Initialising
INITIALISE THE DEVICE CERTIFICATE WITH ALL ITS PROPERTIES EXCEPT CERTIFICATE AUTHORITY SIGNATURE
Declaration
public DeviceCertificate(
Issuer issuer,
DeviceSerial providingSerial,
DeviceSerial gainerSerial,
PublicKey gainingPublicKey)
Parameters
issuer | The issuer's identifying 4 bytes. |
appID | The specific app's identifying 12 bytes (one issuer might have many apps / uses). |
serial | The 9 bytes serial of the device with the certificate |
publicKey | The 64 bytes public key of the device with the certificate. |
Returns
DeviceCertificate
Discussion
The parameters have to be exactly the correct size or the initialisation fails.
Example
DeviceCertificate certificate = new DeviceCertificate(
new Issuer("746D6373"),
new AppIdentifier("5E...DDA5"),
new DeviceSerial("04...704A"),
new PublicKey("E0...CB9F"),
);
INITIALISE THE DEVICE CERTIFICATE WITH BYTES
Declaration
DeviceCertificate(Bytes bytes);
Parameters
bytes | The bytes making up the certificate (at least 89 bytes are expected). |
Returns
DeviceCertificate
Discussion
The alternative constructor instead is recommended for manual initialisation.
Example
Bytes bytes = new Bytes("0103...000B");
DeviceCertificate certificate = new DeviceCertificate(bytes);
Properties
getIssuer()
Declaration
public Issuer getIssuer();
Discussion
The certificate issuer's identifier.
getAppIdentifier()
Declaration
public AppIdentifier getAppIdentifier();
Discussion
The certificate's app identifier.
getSerial()
Declaration
public DeviceSerial getSerial();
Discussion
The serial number of the device.
getPublicKey()
Declaration
public PublicKey getPublicKey();
Discussion
The public key of the device.
Inherited properties
getSignature()
Declaration
Signature getSignature();
Discussion
The certificate authority's signature for the certificate, 64 bytes.
setSignature()
Declaration
setSignature(Signature signature)
Parameters
signature | The new signature |
Example
certificate.setSignature(new Signature("DDEE...00")
getCertificateData()
Declaration
Bytes getCertificateData();
Discussion
The certificate data in binary, excluding the signature.