Exemple #1
0
 private void ValidatePSK(System.Object sender, ValidatePSKEventArgs args)
 {
     #if DEBUG
     Console.WriteLine("Validating PSK identity: " + System.Text.Encoding.UTF8.GetString(args.Identity));
     #endif
     PSKIdentity pskIdentity = BusinessLogicFactory.Identities.GetPSKIdentity(System.Text.Encoding.UTF8.GetString(args.Identity));
     if (pskIdentity != null)
         args.Secret = StringUtils.HexStringToByteArray(pskIdentity.Secret);
 }
        private byte[] FireValidatePSK(byte[] identity)
        {
            EventHandler<ValidatePSKEventArgs> h = ValidatePSK;
            ValidatePSKEventArgs args = new ValidatePSKEventArgs(identity);

            if (h != null)
                h(this, args);

            return args.Secret;
        }