Ejemplo n.º 1
0
 public ZMK_Manager(string keyLabel, byte[] iv)
 {
     if (String.IsNullOrEmpty(keyLabel) || !keyLabel.Length.Equals(KEYLEBAL_LENGTH))
         throw new ArgumentOutOfRangeException("keyLabel is null or length not equals " + KEYLEBAL_LENGTH);
     //if (iv == null || !iv.Length.Equals(IV_LENGTH))
     //    throw new ArgumentOutOfRangeException("iv is null or length not equals " + IV_LENGTH);
     if (dicKmsLoginConfig == null)
     {
         LoadKMSConfig(@"EsKmsWebApiConfig.xml");
     }
     this._keyLabel = keyLabel;
     this._iv = iv;
     this._KMS_WebApi = new EsKmsWebApi()
     {
         Url = dicKmsLoginConfig["Url"],
         //"http://10.27.68.163:8080/eGATEsKMS/interface",
         //"http://127.0.0.1:8081/eGATEsKMS/interface",
         AppCode = dicKmsLoginConfig["AppCode"],
         //"APP_001",
         AuthCode = dicKmsLoginConfig["AuthCode"],
         //"12345678",
         AppName = dicKmsLoginConfig["AppName"],
         //"icash2Test",
         HttpMethod = dicKmsLoginConfig["HttpMethod"],
         //"POST",
         HexConverter = new HexConverter(),
         HashWorker = new HashWorker()
         {
             HashAlg = "SHA1",
             HexConverter = new HexConverter()
         }
     };
 }
Ejemplo n.º 2
0
        public iBonAuthenticate()
        {
            this.hexConverter = new HexConverter();
            this.byteWorker = new ByteWorker();
            this.symCryptor = new SymCryptor();
            this.RandomACreater = new SessionKeyGenerator();
            this.GenerateRanAIndex = new Random(Guid.NewGuid().GetHashCode());
            if (dicKmsLoginConfig == null)
            {
                LoadXmlConfig(@"EsKmsWebApiConfig.xml");
            }
            this.esKmsWebApi = new EsKmsWebApi()
            {
                Url = dicKmsLoginConfig["Url"],
                //"http://10.27.68.163:8080/eGATEsKMS/interface",
                //"http://127.0.0.1:8081/eGATEsKMS/interface",
                AppCode = dicKmsLoginConfig["AppCode"],
                //"APP_001",
                AuthCode = dicKmsLoginConfig["AuthCode"],
                //"12345678",
                AppName = dicKmsLoginConfig["AppName"],
                //"icash2Test",
                HttpMethod = dicKmsLoginConfig["HttpMethod"],
                //"POST",
                HexConverter = new HexConverter(),
                HashWorker = new HashWorker()
                {
                    HashAlg = "SHA1",
                    HexConverter = new HexConverter()
                }
            };

            this.aesCMac2Worker = new AesCMac2Worker(this.esKmsWebApi);
        }
Ejemplo n.º 3
0
        public KMSGetter()
        {
            this.hexConverter = new HexConverter();
            this.byteWorker = new ByteWorker();
            this.symCryptor = new SymCryptor();
            if (dicKmsLoginConfig == null)
            {
                LoadXmlConfig(@"EsKmsWebApiConfig.xml");
            }
            this.esKmsWebApi = new EsKmsWebApi()
            {
                Url = dicKmsLoginConfig["Url"],
                //"http://10.27.68.163:8080/eGATEsKMS/interface",
                //"http://127.0.0.1:8081/eGATEsKMS/interface",
                AppCode = dicKmsLoginConfig["AppCode"],
                //"APP_001",
                AuthCode = dicKmsLoginConfig["AuthCode"],
                //"12345678",
                AppName = dicKmsLoginConfig["AppName"],
                //"icash2Test",
                HttpMethod = dicKmsLoginConfig["HttpMethod"],
                //"POST",
                HexConverter = new HexConverter(),
                HashWorker = new HashWorker()
                {
                    HashAlg = "SHA1",
                    HexConverter = new HexConverter()
                }
            };

            this.aesCMac2Worker = new AesCMac2Worker(this.esKmsWebApi);
        }
Ejemplo n.º 4
0
 public AesCMac2Worker(IEsKmsWebApi esKmsWebApi)
 {
     this.EsCryptor = esKmsWebApi;
     this.ByteWorker = new ByteWorker();
     this.BytesBitwiser = new BytesBitwiser();
     this.HexConverter = new HexConverter();
 }
Ejemplo n.º 5
0
        public void Init()
        {
            this.esKmsWebApi = new EsKmsWebApi()
            {
                Url = "http://127.0.0.1:8081/eGATEsKMS/interface",//"http://10.27.68.163:8080/eGATEsKMS/interface",
                AppCode = "APP_001",
                AuthCode = "12345678",
                AppName = "icash2Test",
                HttpMethod = "POST",
                HexConverter = new HexConverter(),
                HashWorker = new HashWorker()
                {
                    HashAlg = "SHA1",
                    HexConverter = new HexConverter()
                },
            };

            this.hexConverter = new HexConverter();
            this.byteWorker = new ByteWorker();
        }