Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #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;
		}