public override int GetIVSize(string algorithmUri) { string str; if (((str = algorithmUri) == null) || (str != "http://www.w3.org/2001/04/xmlenc#aes128-cbc")) { throw InfoCardTrace.ThrowHelperError(new NotSupportedException(Microsoft.InfoCards.SR.GetString("ClientUnsupportedCryptoAlgorithm", new object[] { algorithmUri }))); } RpcSymmetricCryptoParameters parameters = (RpcSymmetricCryptoParameters)this.m_cryptoHandle.Parameters; return(parameters.blockSize); }
// // Summary: // Returns the size of the initialization vector for the underlying crypto algorithm. // public override int GetIVSize(string algorithmUri) { int size; switch (algorithmUri) { case SecurityAlgorithms.Aes128Encryption: RpcSymmetricCryptoParameters param = (RpcSymmetricCryptoParameters)m_cryptoHandle.Parameters; size = param.blockSize; break; default: throw IDT.ThrowHelperError(new NotSupportedException(SR.GetString(SR.ClientUnsupportedCryptoAlgorithm, algorithmUri))); } return(size); }
public InfoCardSymmetricCrypto(SymmetricCryptoHandle cryptoHandle) { this.m_cryptoHandle = (SymmetricCryptoHandle)cryptoHandle.Duplicate(); try { this.m_params = (RpcSymmetricCryptoParameters)this.m_cryptoHandle.Parameters; } catch { if (this.m_cryptoHandle != null) { this.m_cryptoHandle.Dispose(); this.m_cryptoHandle = null; } throw; } }
public InfoCardSymmetricCrypto(SymmetricCryptoHandle cryptoHandle) { this.m_cryptoHandle = (SymmetricCryptoHandle) cryptoHandle.Duplicate(); try { this.m_params = (RpcSymmetricCryptoParameters) this.m_cryptoHandle.Parameters; } catch { if (this.m_cryptoHandle != null) { this.m_cryptoHandle.Dispose(); this.m_cryptoHandle = null; } throw; } }
public InfoCardSymmetricAlgorithm(SymmetricCryptoHandle cryptoHandle) { this.m_cryptoHandle = (SymmetricCryptoHandle) cryptoHandle.Duplicate(); try { this.m_parameters = (RpcSymmetricCryptoParameters) this.m_cryptoHandle.Parameters; base.KeySizeValue = this.m_parameters.keySize; base.BlockSizeValue = this.m_parameters.blockSize; base.FeedbackSizeValue = this.m_parameters.feedbackSize; base.LegalBlockSizesValue = new KeySizes[] { new KeySizes(base.BlockSizeValue, base.BlockSizeValue, 0) }; base.LegalKeySizesValue = new KeySizes[] { new KeySizes(base.KeySizeValue, base.KeySizeValue, 0) }; } catch { this.m_cryptoHandle.Dispose(); throw; } }
public InfoCardSymmetricAlgorithm(SymmetricCryptoHandle cryptoHandle) { this.m_cryptoHandle = (SymmetricCryptoHandle)cryptoHandle.Duplicate(); try { this.m_parameters = (RpcSymmetricCryptoParameters)this.m_cryptoHandle.Parameters; base.KeySizeValue = this.m_parameters.keySize; base.BlockSizeValue = this.m_parameters.blockSize; base.FeedbackSizeValue = this.m_parameters.feedbackSize; base.LegalBlockSizesValue = new KeySizes[] { new KeySizes(base.BlockSizeValue, base.BlockSizeValue, 0) }; base.LegalKeySizesValue = new KeySizes[] { new KeySizes(base.KeySizeValue, base.KeySizeValue, 0) }; } catch { this.m_cryptoHandle.Dispose(); throw; } }
// // Summary: // Creates a new InfoCardSymmetricCrypto based on a SymmetricCryptoHandle // // Parameters: // cryptoHandle - A handle to the symmetric key on which to base this object. // public InfoCardSymmetricCrypto(SymmetricCryptoHandle cryptoHandle) : base() { m_cryptoHandle = (SymmetricCryptoHandle)cryptoHandle.Duplicate(); try { m_params = (RpcSymmetricCryptoParameters)m_cryptoHandle.Parameters; } catch { if (null != m_cryptoHandle) { m_cryptoHandle.Dispose(); m_cryptoHandle = null; } throw; } }
// // Summary: // Constructs an InfoCardSymmetricAlgorithm // // Parameters: // cryptoHandle - A handle to the symmetric key to base the symmetric algorithm on. // public InfoCardSymmetricAlgorithm(SymmetricCryptoHandle cryptoHandle) : base() { m_cryptoHandle = (SymmetricCryptoHandle)cryptoHandle.Duplicate(); try { m_parameters = (RpcSymmetricCryptoParameters)m_cryptoHandle.Parameters; KeySizeValue = m_parameters.keySize; BlockSizeValue = m_parameters.blockSize; FeedbackSizeValue = m_parameters.feedbackSize; LegalBlockSizesValue = new KeySizes[] { new KeySizes(BlockSizeValue, BlockSizeValue, 0) }; LegalKeySizesValue = new KeySizes[] { new KeySizes(KeySizeValue, KeySizeValue, 0) }; } catch { m_cryptoHandle.Dispose(); throw; } }