public string doGenerateKey(string symmetricKeyType, int length) { SymmetricKeyType sKeyType = SymmetricKeyTypeUtils.getSymmetricKeyType(symmetricKeyType, this.error); if (sKeyType == SymmetricKeyType.GENERICRANDOM) { return(genericKeyGenerator(length)); } this.error.setError("SS003", "Unrecognized SymmetricKeyType"); return(""); }
/// <summary> /// Mapping between SymmetricKeyType enum representation and string name /// </summary> /// <param name="symmetricKeyType">SymmetricKeyType enum, key type name</param> /// <param name="error">Error type for error management</param> /// <returns>string value of key type in string</returns> public static string valueOf(SymmetricKeyType symmetricKeyType, Error error) { switch (symmetricKeyType) { case SymmetricKeyType.GENERICRANDOM: return("GENERICRANDOM"); default: error.setError("SK002", "Unrecognized key type"); return(""); } }