linotp.lib.ImportOTP.oath module

parses CSV data for oath token

linotp.lib.ImportOTP.oath.parseOATHcsv(csv)

This function parses CSV data for oath token. The file format is

serial, key, [hotp,totp], [6,8], [30|60], [sha1|sha256|sha512], serial, key, ocra, [ocra-suite]

It imports standard hmac algorithm based tokens

If the seed is 32 bytes long or at the end of the row the hashlib is

defined the tokens hashlib changes to sha265. For seeds with 64 bytes the hashlib is determined as sha512 if not other specified.

It can also import ocra2 token.

  • The default is hotp

  • if totp is set, the default seconds are 30

  • if ocra is set, an ocra-suite is required

It returns a dictionary:
{
serial: { ‘type’xxxx,

‘hmac_key’ : xxxx, ‘hashlib’ : ‘sha1|sha256|sha512’ ‘timeStep’ : xxxx, ‘otplen’ : xxx, ‘ocrasuite’ : xxx }

}