hmkit-crypto-telematics


License

License

MIT
GroupId

GroupId

com.high-mobility
ArtifactId

ArtifactId

hmkit-crypto-telematics
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

hmkit-crypto-telematics
hmkit-crypto-telematics
Project URL

Project URL

https://github.com/highmobility/hmkit-crypto-java
Source Code Management

Source Code Management

https://github.com/highmobility/hmkit-crypto-java

Download hmkit-crypto-telematics

Dependencies

compile (1)

Group / Artifact Type Version
com.high-mobility : hmkit-utils jar 1.4.5

runtime (2)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.30
org.bouncycastle : bcprov-jdk15on jar 1.68

Project Modules

There are no modules declared in this project.

HMKit Crypto

This repository contains the Certificate classes and public Crypto methods(sign, keygen).

The library should be accessed from either hmkit-oem or hmkit-android. It cannot be used independently because it doesn't include the core.

Dependencies

  • hmkit-core (from either HMKit Android or HMKit OEM)
  • hmkit-utils

Setup

  • Follow the setup process in either HMKit Android or HMKit OEM projects.

Install

Releases are pushed to jcenter. To include hmkit-crypto in your project, add to build.gradle:

repositories {
  jcenter()
}

dependencies {
  // Depending on your environment, use hmkit-oem or hmkit-android to get the transitive crypto
  // dependency 
  // implementation 'com.highmobility:hmkit-oem:2.0.0'
  // or
  // implementation 'com.highmobility:hmkit-android:2.0.3@aar' { transitive = true }
}

Find the latest version names in https://bintray.com/high-mobility/maven/

Certificates

Access Certificate and Device Certificate are represented in this library. The certificates will always be converted to raw bytes that are accessible with Bytes getBytes() method. You can always add a signature later with setSignature(Signature). You can get the certificate data without the signature with getCertificateData().

AccessCertificate

Use one of the designated initialisers to create the object. For example:

public public AccessCertificate(Issuer issuer,
                                DeviceSerial providingSerial,
                                DeviceSerial gainerSerial,
                                PublicKey gainingPublicKey,
                                HMCalendar startDate,
                                HMCalendar endDate,
                                Permissions permissions)

See public getters for certificate info, for example

public Issuer getIssuer()

DeviceCertificate

Use one of the designated initialisers to create the object. For example:

public DeviceCertificate(Issuer issuer,
                         AppIdentifier appIdentifier,
                         DeviceSerial serial,
                         PublicKey publicKey)

See public getters for certificate info, for example

public PublicKey getPublicKey()

Crypto

Use Crypto.java static methods to

create a key pair

public static HMKeyPair createKeypair()

create a random serial number

public static DeviceSerial createSerialNumber()

sign

public static Signature sign(Bytes bytes, PrivateKey privateKey)

Note that all of the Certificate fields(Issuer, DeviceSerial) inherit from custom Bytes class whose methods can be used for general initialisation, comparison and description.

com.high-mobility

HIGH MOBILITY

Versions

Version
0.1