Nexus Documentation
Breadcrumbs

Certificate filtering for Smart ID authentication

This article describes how to set up certificate filtering for the Personal Mobile and Personal Desktop authentication methods in Digital Access. To do this, you add an extended property in the authentication method.

Prerequisites
  • The Personal Mobile and Personal Desktop authentication methods are set and enabled in Digital Access. Read more here: Set up Smart ID authentication.

  • A json is defined including the necessary information for the filtering. See examples in this article.

Step-by-step instruction to set up the filter

Log in to Digital Access Admin
  1. Log in to Digital Access Admin with an administrator account.

Edit the Personal Mobile or the Personal Desktop authentication method
  1. In Digital Access Admin, go to Manage System.

  2. Click Authentication Methods.

  3. Select the Personal Mobile or the Personal Desktop method in the list of Registered Authentication Methods.

  4. Go to the Extended Properties tab.

  5. Click Add Extended Property... 

  6. Select Certificate Filter. The value of this filter shall be a valid json constructed based on the type of filtering you want to achieve. More details about how to create the filter json can be found in the examples in this page.

  7. Click Save.

  8. Click Publish.

About the filter json with examples

Filter objects

Each filter object shall have an op parameter (operation), whose value signifies what type of filter operation it represents. If no operation is specified, the default operation and will be used. 

Logical filter

The logical filter contains a list of operations. The value (value) in a logic filter is a list of more filters.

The logical filter operations are:

  • and

  • or

  • not

Value filter

The value filter contains one parameter (param) (which depends on the operation) and a value (value).

The value filter operations are:

  • eq (Equals)

  • nq (Not Equals)

  • co (Contains)

  • sw (Starts with)

  • ew (Ends with)

  • lt (Less than)

  • gt (Greater than)

  • lte (Less than or equal to)
    'le' is implemented in the mobile apps

  • gte (Greater than or equal to)
    'ge' is implemented in the mobile apps


Examples of a filter json

A simple filter json:

Example: A simple filter that requests a key with ID 'signer'
JavaScript
{
  "op": "eq",
  "param": "cert.issuer.o",
  "value": "Example company"
}

A complex filter json:

Example: A more complex filter
JavaScript
{
  "op":"and",
  "value":[
    {
      "param": "key.id",
      "op":"eq", 
      "value": "signing" 
    },
    {
      "param": "cert.subject.cn", 
      "op":"eq", 
      "value": "Samuel" 
    },
    {
     "op":"or",
     "value":[
       {
        "op":"and",
        "value":[
          {
            "param": "key.type",
            "op":"eq", 
            "value": "RSA" 
                                 },
          {
            "param": "key.size",
            "op":"gte",
            "value":2048
          }
        ]
      },
      {
       "op":"and",
       "value":[
         {
           "param": "key.type",
           "op":"eq",
           "value": "ECC"
         },
         {
           "param": "key.size",
           "op":"gte",
           "value":192
         }
       ]
      }
     ]
    }
  ]
}


Supported request filter parameters

Supported request filter parameters

These are the supported request filters in Smart ID Mobile App, Smart ID Desktop App and Personal Desktop Client.

Name:

acronym:

Android:

iOS:

Desktop App:

Desktop Client:

Note

Constructed Filters:






"value" is a list of other filters, "param" is null

AND

and

check mark

check mark

check mark

check mark


OR

or

check mark

check mark

check mark

check mark


NOT (implemented as NOR)

not

check mark

check mark

check mark

check mark

No filter is allowed to be true if the evaluation of this filter is true








Value Filters:






"value" is string or number, "param" is one of the strings in the list below

CONTAINS

co

check mark

check mark

check mark

check mark

only string param value

STARTS WITH

sw

check mark

check mark

check mark

check mark

only string param value

ENDS WITH

ew

check mark

check mark

check mark

check mark

only string param value

EQUALS

eq

check mark

check mark

check mark

check mark

string or number supported

NOT EQUALS

nq

check mark

check mark

check mark

check mark

string or number supported

LESS THAN

lt

check mark

check mark

check mark

check mark

string or number supported

GREATER THAN

gt

check mark

check mark

check mark

check mark

string or number supported

LESS OR EQUAL

le

check mark

check mark

check mark

check mark

string or number supported

GREATER OR EQUAL

ge

check mark

check mark

check mark

check mark

string or number supported








Filter Param 'keys':







ISSUER COUNTRY

cert.issuer.c

check mark

check mark

check mark

check mark


ISSUER COMMON NAME

cert.issuer.cn

check mark

check mark

check mark

check mark


ISSUER LOCALITY

cert.issuer.l

check mark

check mark

check mark

check mark


ISSUER ORGANISATION

cert.issuer.o

check mark

check mark

check mark

check mark


ISSUER ORGANISATIONAL UNIT

cert.issuer.ou

check mark

check mark

check mark

check mark

fixed in android now

ISSUER STATE

cert.issuer.st

check mark

check mark

check mark

check mark


ISSUER STATE variant

cert.issuer.s

cross mark

cross mark

check mark

cross mark


ISSUER STREET

cert.issuer.street

check mark

check mark

check mark

check mark


ISSUER EMAIL

cert.issuer.email

cross mark

cross mark

check mark

cross mark


ISSUER UID

cert.issuer.uid

cross mark

cross mark

check mark

cross mark


KEY USAGE

cert.keyusage

check mark

check mark

check mark

cross mark

Use primarily with contains. We are concatenating all of them into one string

SERIAL

cert.serial

check mark

check mark

check mark

cross mark


SUBJECT COUNTRY

cert.subject.c

check mark

check mark

check mark

check mark


SUBJECT COMMON NAME

cert.subject.cn

check mark

check mark

check mark

check mark


SUBJECT LOCALITY

cert.subject.l

check mark

check mark

check mark

check mark


SUBJECT ORGANISATION

cert.subject.o

check mark

check mark

check mark

check mark


SUBJECT ORG UNIT

cert.subject.ou

check mark

check mark

check mark

check mark


SUBJECT STATE

cert.subject.st

check mark

check mark

check mark

check mark


SUBJECT STATE variant

cert.issuer.s

cross mark

cross mark

check mark

cross mark


SUBJECT STREET

cert.subject.street

check mark

check mark

check mark

check mark


SUBJECT EMAIL

cert.subject.email

cross mark

cross mark

check mark

cross mark


SUBEJCT UID

cert.subject.uid

cross mark

cross mark

check mark

cross mark


KEY ID

key.id

check mark

check mark

check mark

check mark


KEY PUBLIC KEY

key.publickey

check mark

check mark

check mark

cross mark

BASE64 encoded DER (no PEM headers or newlines)

KEY SIZE

key.size

check mark

check mark

check mark

check mark


KEY TYPE

key.type

check mark

check mark

check mark

check mark

always 'RSA' so far

TOKEN ID

token.id

check mark

check mark

check mark

check mark

Profile ID for Hermod profiles

TOKEN TYPE

token.type

check mark

check mark

check mark

cross mark

'DIGITAL' and 'NFC' used in mobile. PDA version values: 'Microsoft Platform Crypto Provider', 'MICROSOFT BASE SMART CARD CRYPTO PROVIDER', 'MICROSOFT ENHANCED CRYPTOGRAPHIC PROVIDER V1.0', 'MICROSOFT SOFTWARE KEY STORAGE PROVIDER', 'MICROSOFT PASSPORT KEY STORAGE PROVIDER'

TOKEN USER ID

token.userid

check mark

check mark

check mark

check mark

username tied to the token

TOKEN PROFILE TYPE

token.profiletype

cross mark

cross mark

check mark

cross mark

VSC, SW, PLATFORMTPM, YUBI, HYBRID, FILEP12SW, FILEP12TPM, FILETPMYUBI, LOCALID06, FILEP12VSC