Ejemplo n.º 1
0
        public override DeviceRegistration CreateDeviceRegistration()
        {
            byte[] ekBuffer  = _security.GetEndorsementKey();
            byte[] srkBuffer = _security.GetStorageRootKey();

            string ek  = Convert.ToBase64String(ekBuffer);
            string srk = Convert.ToBase64String(srkBuffer);

            return(new DeviceRegistration(_security.GetRegistrationID(), new TpmAttestation(ek, srk)));
        }
Ejemplo n.º 2
0
        public override AmqpSettings CreateAmqpSettings(string idScope)
        {
            var settings = new AmqpSettings();

            var saslProvider = new SaslTransportProvider();

            saslProvider.Versions.Add(AmqpConstants.DefaultProtocolVersion);
            settings.TransportProviders.Add(saslProvider);

            byte[]         ekBuffer   = _security.GetEndorsementKey();
            byte[]         srkBuffer  = _security.GetStorageRootKey();
            SaslTpmHandler tpmHandler = new SaslTpmHandler(ekBuffer, srkBuffer, idScope, _security);

            saslProvider.AddHandler(tpmHandler);

            return(settings);
        }