PIV has been standardized by the National Institute for Standards and Technology (NIST) in FIPS 201-2. The relevant hardware security specifications are provided in SP 800-73-4 and SP 800-78-4. It was originally specified for use by the US Federal government. Nowadays, it is also widely deployed in the private sector.
Using our SDK you can easily bring PIV support to your Android app:
Supports a wide range of Security Keys, such as the YubiKey 4 and 5 Series over USB. YubiKey 5 NFC and YubiKey NEO are also supported over NFC.
public class MainActivity extends AppCompatActivity implements SecurityKeyDialogCallback<PivSecurityKey> {
private void showSecurityKeyDialog() {
SecurityKeyDialogOptions options = SecurityKeyDialogOptions.builder()
//.setPinLength(4) // smartcards with a fixed PIN and PUK length improve the UX
//.setPukLength(8)
.build();
SecurityKeyDialogFragment<PivSecurityKey> securityKeyDialogFragment =
PivSecurityKeyDialogFragment.newInstance(options);
securityKeyDialogFragment.show(getSupportFragmentManager());
}
@Override
public void onSecurityKeyDialogDiscovered(SecurityKeyDialogInterface dialogInterface,
PivSecurityKey securityKey, PinProvider pinProvider) throws IOException {
SecurityKeyTlsClientCertificateAuthenticator clientCertificateAuthenticator =
securityKey.createSecurityKeyClientCertificateAuthenticator(pinProvider);
SSLContext sslContext = clientCertificateAuthenticator.buildInitializedSslContext();
// connection with OkHttp
OkHttpClient httpClient = new OkHttpClient.Builder()
.sslSocketFactory(sslContext.getSocketFactory())
.build();
Request request = new Request.Builder()
.url("https://tls.hwsecurity.dev")
.build();
Response response = httpClient.newCall(request).execute();
}
}