RestImageResize/Security/AppSettingsPrivateKeyProvider.cs
/// <summary>
/// Get all configured private keys from app settings. The format of the app setting is "{pk1:abc123|pk2:456edf}" (keys are pipe-delimited, each containing a name and a private key itself).
/// </summary>
Get all configured private keys from app settings. The format of the app setting is "{pk1:abc123|pk2:456edf}" (keys are pipe-delimited, each containing a name and a private key itself).
Get all configured private keys from app settings . The format of the app setting is " { pk1 : abc123|pk2 : 456edf } " ( keys are pipe - delimited each containing a name and a private key itself ) .
public IEnumerable<PrivateKey> GetAllPrivateKeys()
        {
            var privateKeysString = Config.PrivateKeys;
            if (string.IsNullOrEmpty(privateKeysString))
            {
                return new List<PrivateKey>();
            }
            var privateKeys = privateKeysString.Split('|')
                .Select(val => new PrivateKey
                {
                    Name = val.Split(':').First(),
                    Key = val.Split(':').Last()
                })
                .ToList();
            return privateKeys;
        }
public IEnumerable < PrivateKey > GetAllPrivateKeys ( ) { var privateKeysString = Config . PrivateKeys ; if ( string . IsNullOrEmpty ( privateKeysString ) ) { return new List < PrivateKey > ( ) ; } var privateKeys = privateKeysString . Split ( ' ' ) . Select ( val => new PrivateKey { Name = val . Split ( ' ' ) . First ( ) , Key = val . Split ( ' ' ) . Last ( ) } ) . ToList ( ) ; return privateKeys ; }
Get all configured private keys from app settings.
Get all configured private keys from app settings .