public void SetSCPVersion(SCPVersions scp)
        {
            // Major version of wrapper
            this.scp = 2;
            if (scp == SCPVersions.SCP_01_05)// || scp == SCPVersions.SCP_01_15)
            {
                this.scp = 1;
            }

            // modes
            //if ((scp == SCPVersions.SCP_01_15) || (scp == SCPVersions.SCP_02_14) || (scp == SCPVersions.SCP_02_15) || (scp == SCPVersions.SCP_02_1A) || (scp == SCPVersions.SCP_02_1B))
            if (scp == SCPVersions.SCP_02_15)
            {
                icvEnc = true;
            }
            else
            {
                icvEnc = false;
            }

            //if ((scp == SCPVersions.SCP_01_05) || (scp == SCPVersions.SCP_01_15) || (scp == SCPVersions.SCP_02_04) || (scp == SCPVersions.SCP_02_05) || (scp == SCPVersions.SCP_02_14) || (scp == SCPVersions.SCP_02_15))
            if ((scp == SCPVersions.SCP_01_05) || (scp == SCPVersions.SCP_02_15))
            {
                preAPDU = true;
            }
            else
            {
                preAPDU = false;
            }

            //if ((scp == SCPVersions.SCP_02_0A) || (scp == SCPVersions.SCP_02_0B) || (scp == SCPVersions.SCP_02_1A) || (scp == SCPVersions.SCP_02_1B))
            //    postAPDU = true;
            //else
            postAPDU = false;
        }
 public SCP0102Wrapper(GPKeySet sessionKeys, SCPVersions scp, List <APDUMode> securityLevel, byte[] icv, byte[] ricv, int bs)
 {
     this.blockSize   = bs;
     this.sessionKeys = sessionKeys;
     this.icv         = icv;
     this.ricv        = ricv;
     SetSCPVersion(scp);
     SetSecurityLevel(securityLevel);
 }
Exemple #3
0
        public SCP03Wrapper(GPKeySet sessionKeys, SCPVersions scp, List <APDUMode> securityLevel, byte[] icv, byte[] ricv, int bs)
        {
            this.sessionKeys = sessionKeys;
            this.blockSize   = bs;
            // initialize chaining value.
            Array.Copy(GPCrypto.null_bytes_16, 0, chaining_value, 0, GPCrypto.null_bytes_16.Length);
            // initialize encryption counter.
            Array.Copy(GPCrypto.null_bytes_16, 0, encryption_counter, 0, GPCrypto.null_bytes_16.Length);

            SetSecurityLevel(securityLevel);
        }