| | | 1 | | using System; |
| | | 2 | | |
| | | 3 | | namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto |
| | | 4 | | { |
| | | 5 | | internal class AsymmetricCipherKeyPair |
| | | 6 | | { |
| | | 7 | | private readonly AsymmetricKeyParameter publicParameter; |
| | | 8 | | private readonly AsymmetricKeyParameter privateParameter; |
| | | 9 | | |
| | 9 | 10 | | public AsymmetricCipherKeyPair( |
| | 9 | 11 | | AsymmetricKeyParameter publicParameter, |
| | 9 | 12 | | AsymmetricKeyParameter privateParameter) |
| | 9 | 13 | | { |
| | 9 | 14 | | if (publicParameter.IsPrivate) |
| | 0 | 15 | | throw new ArgumentException("Expected a public key", "publicParameter"); |
| | 9 | 16 | | if (!privateParameter.IsPrivate) |
| | 0 | 17 | | throw new ArgumentException("Expected a private key", "privateParameter"); |
| | | 18 | | |
| | 9 | 19 | | this.publicParameter = publicParameter; |
| | 9 | 20 | | this.privateParameter = privateParameter; |
| | 9 | 21 | | } |
| | | 22 | | |
| | | 23 | | public AsymmetricKeyParameter Public |
| | | 24 | | { |
| | 27 | 25 | | get { return publicParameter; } |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | public AsymmetricKeyParameter Private |
| | | 29 | | { |
| | 27 | 30 | | get { return privateParameter; } |
| | | 31 | | } |
| | | 32 | | } |
| | | 33 | | } |