API Reference
Class
OtpQrPreset
Opinionated QR presets for OTP URIs.
Inheritance
- Object
- OtpQrPreset
Methods
public static QrPngRenderOptions CreatePngRenderOptions(Int32 moduleSize = 6, Int32 quietZone = 4, Nullable<Rgba32> foreground = null, Nullable<Rgba32> background = null) #Returns:
QrPngRenderOptionsCreates PNG render options optimized for OTP QR readability.
Parameters
- moduleSize System.Int32 = 6
- quietZone System.Int32 = 4
- foreground System.Nullable{CodeGlyphX.Rendering.Png.Rgba32} = null
- background System.Nullable{CodeGlyphX.Rendering.Png.Rgba32} = null
EncodeHotp 2 overloads
public static QrCode EncodeHotp(String issuer, String account, ReadOnlySpan<Byte> secret, Int64 counter, OtpAlgorithm alg = Sha1, Int32 digits = 6, QrErrorCorrectionLevel ecc = H, Int32 minVersion = 1, Int32 maxVersion = 10, Nullable<Int32> forceMask = null) #Returns:
QrCodeBuilds a HOTP otpauth:// URI and encodes it as a QR code.
Parameters
- issuer System.String
- account System.String
- secret System.Byte[]
- counter System.Int64
- alg CodeGlyphX.OtpAlgorithm = Sha1
- digits System.Int32 = 6
- ecc CodeGlyphX.QrErrorCorrectionLevel = H
- minVersion System.Int32 = 1
- maxVersion System.Int32 = 10
- forceMask System.Nullable{System.Int32} = null
EncodeHotp(System.String issuer, System.String account, System.ReadOnlySpan{System.Byte} secret, System.Int64 counter, CodeGlyphX.OtpAlgorithm alg, System.Int32 digits, CodeGlyphX.QrErrorCorrectionLevel ecc, System.Int32 minVersion, System.Int32 maxVersion, System.Nullable{System.Int32} forceMask) #Builds a HOTP otpauth:// URI and encodes it as a QR code.
Parameters
- issuer System.String
- account System.String
- secret System.ReadOnlySpan{System.Byte}
- counter System.Int64
- alg CodeGlyphX.OtpAlgorithm
- digits System.Int32
- ecc CodeGlyphX.QrErrorCorrectionLevel
- minVersion System.Int32
- maxVersion System.Int32
- forceMask System.Nullable{System.Int32}
EncodeTotp 2 overloads
public static QrCode EncodeTotp(String issuer, String account, ReadOnlySpan<Byte> secret, OtpAlgorithm alg = Sha1, Int32 digits = 6, Int32 period = 30, QrErrorCorrectionLevel ecc = H, Int32 minVersion = 1, Int32 maxVersion = 10, Nullable<Int32> forceMask = null) #Returns:
QrCodeBuilds a TOTP otpauth:// URI and encodes it as a QR code.
Parameters
- issuer System.String
- account System.String
- secret System.Byte[]
- alg CodeGlyphX.OtpAlgorithm = Sha1
- digits System.Int32 = 6
- period System.Int32 = 30
- ecc CodeGlyphX.QrErrorCorrectionLevel = H
- minVersion System.Int32 = 1
- maxVersion System.Int32 = 10
- forceMask System.Nullable{System.Int32} = null
EncodeTotp(System.String issuer, System.String account, System.ReadOnlySpan{System.Byte} secret, CodeGlyphX.OtpAlgorithm alg, System.Int32 digits, System.Int32 period, CodeGlyphX.QrErrorCorrectionLevel ecc, System.Int32 minVersion, System.Int32 maxVersion, System.Nullable{System.Int32} forceMask) #Builds a TOTP otpauth:// URI and encodes it as a QR code.
Parameters
- issuer System.String
- account System.String
- secret System.ReadOnlySpan{System.Byte}
- alg CodeGlyphX.OtpAlgorithm
- digits System.Int32
- period System.Int32
- ecc CodeGlyphX.QrErrorCorrectionLevel
- minVersion System.Int32
- maxVersion System.Int32
- forceMask System.Nullable{System.Int32}
public static QrCode EncodeUri(String otpauthUri, QrErrorCorrectionLevel ecc = H, Int32 minVersion = 1, Int32 maxVersion = 10, Nullable<Int32> forceMask = null) #Returns:
QrCodeEncodes a pre-built otpauth:// URI as a QR code.
Parameters
- otpauthUri System.String
- ecc CodeGlyphX.QrErrorCorrectionLevel = H
- minVersion System.Int32 = 1
- maxVersion System.Int32 = 10
- forceMask System.Nullable{System.Int32} = null