Fix IDE0025 (use expression body for properties)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / Reflection / StrongNameKeyPair.cs
blob03e7f121a80e86ce14f503bf5656d0f33c41f464
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System.IO;
6 using System.Runtime.Serialization;
8 namespace System.Reflection
10 public class StrongNameKeyPair : IDeserializationCallback, ISerializable
12 // Build key pair from file.
13 public StrongNameKeyPair(FileStream keyPairFile)
15 if (keyPairFile == null)
16 throw new ArgumentNullException(nameof(keyPairFile));
18 int length = (int)keyPairFile.Length;
19 byte[] keyPairArray = new byte[length];
20 keyPairFile.Read(keyPairArray, 0, length);
23 // Build key pair from byte array in memory.
24 public StrongNameKeyPair(byte[] keyPairArray)
26 if (keyPairArray == null)
27 throw new ArgumentNullException(nameof(keyPairArray));
30 protected StrongNameKeyPair(SerializationInfo info, StreamingContext context) =>
31 throw new PlatformNotSupportedException();
33 public StrongNameKeyPair(string keyPairContainer) =>
34 throw new PlatformNotSupportedException(SR.PlatformNotSupported_StrongNameSigning);
36 public byte[] PublicKey =>
37 throw new PlatformNotSupportedException(SR.PlatformNotSupported_StrongNameSigning);
39 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) =>
40 throw new PlatformNotSupportedException();
42 void IDeserializationCallback.OnDeserialization(object? sender) =>
43 throw new PlatformNotSupportedException();