Exemplo n.º 1
0
        /// <summary>
        /// Creates a signed address book entry that describes the public information in this endpoint.
        /// </summary>
        /// <param name="cryptoServices">The crypto services to use for signing the address book entry.</param>
        /// <returns>The address book entry.</returns>
        public AddressBookEntry CreateAddressBookEntry(ICryptoProvider cryptoServices)
        {
            Requires.NotNull(cryptoServices, "cryptoServices");

            var ms     = new MemoryStream();
            var writer = new BinaryWriter(ms);
            var entry  = new AddressBookEntry();

            writer.SerializeDataContract(this.PublicEndpoint);
            writer.Flush();
            entry.SerializedEndpoint = ms.ToArray();
            entry.Signature          = cryptoServices.Sign(entry.SerializedEndpoint, this.SigningKeyPrivateMaterial);
            return(entry);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a signed address book entry that describes the public information in this endpoint.
        /// </summary>
        /// <param name="cryptoServices">The crypto services to use for signing the address book entry.</param>
        /// <returns>The address book entry.</returns>
        public AddressBookEntry CreateAddressBookEntry(CryptoSettings cryptoServices)
        {
            Requires.NotNull(cryptoServices, "cryptoServices");

            var ms     = new MemoryStream();
            var writer = new BinaryWriter(ms);
            var entry  = new AddressBookEntry();

            writer.SerializeDataContract(this.PublicEndpoint);
            writer.Flush();
            entry.SerializedEndpoint = ms.ToArray();
            entry.Signature          = WinRTCrypto.CryptographicEngine.Sign(this.SigningKey, entry.SerializedEndpoint);
            return(entry);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a signed address book entry that describes the public information in this endpoint.
        /// </summary>
        /// <param name="cryptoServices">The crypto services to use for signing the address book entry.</param>
        /// <returns>The address book entry.</returns>
        public AddressBookEntry CreateAddressBookEntry(CryptoSettings cryptoServices)
        {
            Requires.NotNull(cryptoServices, "cryptoServices");

            var ms = new MemoryStream();
            var writer = new BinaryWriter(ms);
            var entry = new AddressBookEntry();
            writer.SerializeDataContract(this.PublicEndpoint);
            writer.Flush();
            entry.SerializedEndpoint = ms.ToArray();
            entry.Signature = WinRTCrypto.CryptographicEngine.Sign(this.SigningKey, entry.SerializedEndpoint);
            return entry;
        }
Exemplo n.º 4
0
		/// <summary>
		/// Creates a signed address book entry that describes the public information in this endpoint.
		/// </summary>
		/// <param name="cryptoServices">The crypto services to use for signing the address book entry.</param>
		/// <returns>The address book entry.</returns>
		public AddressBookEntry CreateAddressBookEntry(ICryptoProvider cryptoServices) {
			Requires.NotNull(cryptoServices, "cryptoServices");

			var ms = new MemoryStream();
			var writer = new BinaryWriter(ms);
			var entry = new AddressBookEntry();
			writer.SerializeDataContract(this.PublicEndpoint);
			writer.Flush();
			entry.SerializedEndpoint = ms.ToArray();
			entry.Signature = cryptoServices.Sign(entry.SerializedEndpoint, this.SigningKeyPrivateMaterial);
			return entry;
		}