H DFTACTGRP(*NO) BNDDIR('QC2LE') D Crypto_Attr_T ds qualified D algorithm 2A D key_length 5I 0 D bitflags 2A D MMTR_01C8_T ds qualified D numEntries 5I 0 D entries 6A dim(100) D MMTR_Template_T... D ds qualified based(Template_Only) D Template_Size 10I 0 D Bytes_Used 10I 0 D Crypto_Attrs 602A D MMTR_CRYTPOGRAPHY... D C 456 D GetAlgName PR 45A varying D Algorithm 2A const D matmatr pr extproc('matmatr') D receiver likeds(MMTR_Template_T) D attr 5I 0 value D r ds likeds(MMTR_TEMPLATE_T) D x s 10I 0 D msg s 52A /free r.Template_Size = %size(r); matmatr(r: MMTR_CRYTPOGRAPHY); MMTR_01C8_T = r.Crypto_Attrs; for x = 1 to MMTR_01C8_T.numEntries; Crypto_Attr_T = MMTR_01C8_T.entries(x); msg = %char(Crypto_Attr_T.key_length) + '-bit ' + GetAlgName(Crypto_Attr_T.algorithm); dsply msg; endfor; *inlr = *on; /end-free *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * GetAlgName(): Get Algorithm Name * * Algorithm -- Algorithm returned by MATMATR MI function * * Returns a human-readable algorithm name *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ P GetAlgName B D GetAlgName PI 45A varying D Algorithm 2A const /free select; when Algorithm = x'0001'; return 'MAC - Message Authentication Code'; when Algorithm = x'0002'; return 'MD5'; when Algorithm = x'0003'; return 'SHA-1 - Secure Hash Algorithm'; when Algorithm = x'0004'; return 'DES (one-way) - Data Encryption Standard'; when Algorithm = x'0005'; return 'DES (two-way) - Data Encryption Standard'; when Algorithm = x'0006'; return 'RC4'; when Algorithm = x'0007'; return 'RC5'; when Algorithm = x'0008'; return 'DESX'; when Algorithm = x'0009'; return '3DES - Triple DES'; when Algorithm = x'000A'; return 'DSA - Digital Signature Algorithm'; when Algorithm = x'000B'; return 'RSA - Rivest/Shamir/Adleman'; when Algorithm = x'000C'; return 'Diffie-Hellman'; when Algorithm = x'000D'; return 'CDMF - Commercial Data Masking Facility'; when Algorithm = x'000E'; return 'RC2'; when Algorithm = x'000F'; return 'AES - Advanced Encryption Standard'; other; return 'Unknown'; endsl; /end-free P E