public AsymmetricKeyProvider(OidToCipherTypeMapper cipherTypeMapper, KeyInfoWrapper keyInfoWrapper, IKeyProvider <RsaKey> rsaKeyProvider, IKeyProvider <DsaKey> dsaKeyProvider, IEcKeyProvider ecKeyProvider, IElGamalKeyProvider elGamalKeyProvider)
 {
     this.cipherTypeMapper   = cipherTypeMapper;
     this.rsaKeyProvider     = rsaKeyProvider;
     this.dsaKeyProvider     = dsaKeyProvider;
     this.ecKeyProvider      = ecKeyProvider;
     this.elGamalKeyProvider = elGamalKeyProvider;
     this.keyInfoWrapper     = keyInfoWrapper;
 }
Exemplo n.º 2
0
        private void SetupValidKeyInfo()
        {
            keyInfoWrapper.Setup(k => k.GetPublicKeyInfo(It.IsAny <byte[]>()))
            .Returns <byte[]>(content =>
            {
                var wrapper = new KeyInfoWrapper();
                return(wrapper.GetPublicKeyInfo(content));
            });

            keyInfoWrapper.Setup(k => k.GetPrivateKeyInfo(It.IsAny <byte[]>()))
            .Returns <byte[]>(content =>
            {
                var wrapper = new KeyInfoWrapper();
                return(wrapper.GetPrivateKeyInfo(content));
            });
        }