Пример #1
0
 public JWTHS256CryptoMessageAlgorithm(ICryptoManagerImplementation director, IConfigSectionNode config) : base(director, config)
 {
     m_HMACKey = BuildKeyFromConfig(config[CONFIG_HMAC_SECTION], 64);//HMAC SHA2 = 64 byte key
     //  The secret key for System.Security.Cryptography.HMACSHA256 encryption. The key
     //     can be any length. However, the recommended size is 64 bytes. If the key is more
     //     than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key. If
     //     it is less than 64 bytes long, it is padded to 64 bytes.
 }
Пример #2
0
        protected override void DoConfigure(IConfigSectionNode node)
        {
            base.DoConfigure(node);
            m_Config = node;

            DisposeAndNull(ref m_Cryptography);
            m_Cryptography = FactoryUtils.MakeAndConfigureDirectedComponent <ICryptoManagerImplementation>(
                this,
                node[CONFIG_CRYPTOGRAPHY_SECTION],
                typeof(DefaultCryptoManager));

            DisposeAndNull(ref m_PasswordManager);
            m_PasswordManager = FactoryUtils.MakeAndConfigureDirectedComponent <IPasswordManagerImplementation>(
                this,
                node[CONFIG_PASSWORD_MANAGER_SECTION],
                typeof(DefaultPasswordManager));
        }
Пример #3
0
 public HMACAESCryptoMessageAlgorithm(ICryptoManagerImplementation director, IConfigSectionNode config) : base(director, config)
 {
     m_HMACKeys = BuildKeysFromConfig(config, CONFIG_HMAC_SECTION, 64);     //HMAC SHA2 = 64 byte key
     m_AESKeys  = BuildKeysFromConfig(config, CONFIG_AES_SECTION, 256 / 8); //AES256 = 256 bit key
 }
Пример #4
0
 protected CryptoMessageAlgorithm(ICryptoManagerImplementation director, IConfigSectionNode config) : base(director)
 {
     ConfigAttribute.Apply(this, config.NonEmpty("{0}.ctor(config=null|!Exists)".Args(GetType().Name)));
 }