|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | + |
| 5 | +namespace Regula.DocumentReader.WebClient.Model.Ext.Autheticity |
| 6 | +{ |
| 7 | + public static class Authenticity |
| 8 | + { |
| 9 | + |
| 10 | + public static SecurityFeatureChecks UvLuminescenceChecks(this AuthenticityCheckList auth) |
| 11 | + { |
| 12 | + return auth.securityFeatureOrNull(AuthenticityResultType.UV_LUMINESCENCE); |
| 13 | + } |
| 14 | + |
| 15 | + public static SecurityFeatureChecks IrB900Checks(this AuthenticityCheckList auth) |
| 16 | + { |
| 17 | + return auth.securityFeatureOrNull(AuthenticityResultType.IR_B900); |
| 18 | + } |
| 19 | + |
| 20 | + public static IdentChecks ImagePattern(this AuthenticityCheckList auth) |
| 21 | + { |
| 22 | + return auth.identOrNull(AuthenticityResultType.IMAGE_PATTERN); |
| 23 | + } |
| 24 | + |
| 25 | + public static SecurityFeatureChecks AxialProtectionChecks(this AuthenticityCheckList auth) |
| 26 | + { |
| 27 | + return auth.securityFeatureOrNull(AuthenticityResultType.AXIAL_PROTECTION); |
| 28 | + } |
| 29 | + |
| 30 | + public static FiberChecks UVFiberChecks(this AuthenticityCheckList auth) |
| 31 | + { |
| 32 | + return auth.filberOrNull(AuthenticityResultType.UV_FIBERS); |
| 33 | + } |
| 34 | + |
| 35 | + public static IdentChecks IRVisibilityChecks(this AuthenticityCheckList auth) |
| 36 | + { |
| 37 | + return auth.identOrNull(AuthenticityResultType.IR_VISIBILITY); |
| 38 | + } |
| 39 | + |
| 40 | + public static OCRSecurityTextChecks OCRSecurityTextChecks(this AuthenticityCheckList auth) |
| 41 | + { |
| 42 | + return auth.ocrSecurityTextOrNull(AuthenticityResultType.OCR_SECURITY_TEXT); |
| 43 | + } |
| 44 | + |
| 45 | + public static ImageIdentChecks IpiChecks(this AuthenticityCheckList auth) |
| 46 | + { |
| 47 | + return auth.imageIdentOrNull(AuthenticityResultType.IPI); |
| 48 | + } |
| 49 | + |
| 50 | + public static SecurityFeatureChecks EmbededImageChecks(this AuthenticityCheckList auth) |
| 51 | + { |
| 52 | + return auth.securityFeatureOrNull(AuthenticityResultType.PHOTO_EMBED_TYPE); |
| 53 | + } |
| 54 | + |
| 55 | + public static SecurityFeatureChecks HologramsChecks(this AuthenticityCheckList auth) |
| 56 | + { |
| 57 | + return auth.securityFeatureOrNull(AuthenticityResultType.HOLOGRAMS); |
| 58 | + } |
| 59 | + |
| 60 | + public static SecurityFeatureChecks ImageAreaChecks(this AuthenticityCheckList auth) |
| 61 | + { |
| 62 | + return auth.securityFeatureOrNull(AuthenticityResultType.PHOTO_AREA); |
| 63 | + } |
| 64 | + |
| 65 | + public static IdentChecks portraitComparisonChecks(this AuthenticityCheckList auth) |
| 66 | + { |
| 67 | + return auth.identOrNull(AuthenticityResultType.PORTRAIT_COMPARISON); |
| 68 | + } |
| 69 | + |
| 70 | + public static SecurityFeatureChecks BarcodeFormatCheckChecks(this AuthenticityCheckList auth) |
| 71 | + { |
| 72 | + return auth.securityFeatureOrNull(AuthenticityResultType.BARCODE_FORMAT_CHECK); |
| 73 | + } |
| 74 | + |
| 75 | + public static IdentChecks KinegramChecks(this AuthenticityCheckList auth) |
| 76 | + { |
| 77 | + return auth.identOrNull(AuthenticityResultType.KINEGRAM); |
| 78 | + } |
| 79 | + |
| 80 | + public static IdentChecks LetterScreenChecks(this AuthenticityCheckList auth) |
| 81 | + { |
| 82 | + return auth.identOrNull(AuthenticityResultType.LETTER_SCREEN); |
| 83 | + } |
| 84 | + |
| 85 | + |
| 86 | + private static AuthenticityCheckResult resultByType(this AuthenticityCheckList auth, int type) |
| 87 | + { |
| 88 | + return auth?.List.FirstOrDefault(t => t.Type == type); |
| 89 | + } |
| 90 | + |
| 91 | + private static FiberChecks filberOrNull(this AuthenticityCheckList auth, int type) |
| 92 | + { |
| 93 | + AuthenticityCheckResult result = auth.resultByType(type); |
| 94 | + return result != null ? new FiberChecks(result) : null; |
| 95 | + } |
| 96 | + |
| 97 | + private static IdentChecks identOrNull(this AuthenticityCheckList auth, int type) |
| 98 | + { |
| 99 | + AuthenticityCheckResult result = auth.resultByType(type); |
| 100 | + return result != null ? new IdentChecks(result) : null; |
| 101 | + } |
| 102 | + |
| 103 | + private static ImageIdentChecks imageIdentOrNull(this AuthenticityCheckList auth, int type) |
| 104 | + { |
| 105 | + AuthenticityCheckResult result = auth.resultByType(type); |
| 106 | + return result != null ? new ImageIdentChecks(result) : null; |
| 107 | + } |
| 108 | + |
| 109 | + private static OCRSecurityTextChecks ocrSecurityTextOrNull(this AuthenticityCheckList auth, int type) |
| 110 | + { |
| 111 | + AuthenticityCheckResult result = auth.resultByType(type); |
| 112 | + return result != null ? new OCRSecurityTextChecks(result) : null; |
| 113 | + } |
| 114 | + |
| 115 | + private static SecurityFeatureChecks securityFeatureOrNull(this AuthenticityCheckList auth, int type) |
| 116 | + { |
| 117 | + AuthenticityCheckResult result = auth.resultByType(type); |
| 118 | + return result != null ? new SecurityFeatureChecks(result) : null; |
| 119 | + } |
| 120 | + |
| 121 | + } |
| 122 | + |
| 123 | +} |
0 commit comments