Create csr modal

The CSR Modal allows users to generate a CSR code. Once the user
types in the necessary information to generate the CSR code, that modal
will then render the code and the user will be able to either copy the
code or download the code in a txt file.

Tested: loaded onto Witherspoon and able to view on certificate
management page.  Click on generate csr and type in necessary
(or any additional info), then click on generate CSR.  The CSR
code is then visible and is able to be copied or downloaded. In
error state in which CSR code is unable to generate, the modal
closes and an error toast message appears. FYI: Sometimes you
have to reboot system in order for csr to successfully generate.y

Signed-off-by: Mira Murali  <miramurali23@gmail.com>
Change-Id: I3cca09c494357496166164b5ee8ff99250ef981d
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index 37dd29f..9ac9b6c 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -24,11 +24,11 @@
         {
           'Description': 'HTTPS Certificate',
           'location':
-              '/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates'
+              '/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/'
         },
         {
           'Description': 'LDAP Certificate',
-          'location': '/redfish/v1/AccountService/LDAP/Certificates'
+          'location': '/redfish/v1/AccountService/LDAP/Certificates/'
         }
       ],
       HOST_STATE_TEXT: {
@@ -102,6 +102,262 @@
         HOST_OFF: 1000 * 60 * 5,           // 5 mins
         HOST_OFF_IMMEDIATE: 1000 * 60 * 2  // 2 mins
       },
+      CERTIFICATE: {
+        KEY_BIT_LENGTH: [2048],
+        KEY_PAIR_ALGORITHM: ['EC', 'RSA'],
+        KEY_CURVE_ID: ['prime256v1', 'secp521r1', 'secp384r1']
+      },
+      COUNTRIES: [
+        {Name: 'Afghanistan', code: 'AF'},
+        {Name: 'Albania', code: 'AL'},
+        {Name: 'Algeria', code: 'DZ'},
+        {Name: 'American Samoa', code: 'AS'},
+        {Name: 'Andorra', code: 'AD'},
+        {Name: 'Angola', code: 'AO'},
+        {Name: 'Anguilla', code: 'AI'},
+        {Name: 'Antarctica', code: 'AQ'},
+        {Name: 'Antigua and Barbuda', code: 'AG'},
+        {Name: 'Argentina', code: 'AR'},
+        {Name: 'Armenia', code: 'AM'},
+        {Name: 'Aruba', code: 'AW'},
+        {Name: 'Australia', code: 'AU'},
+        {Name: 'Austria', code: 'AT'},
+        {Name: 'Azerbaijan', code: 'AZ'},
+        {Name: 'Bahamas, The', code: 'BS'},
+        {Name: 'Bahrain', code: 'BH'},
+        {Name: 'Bangladesh', code: 'BD'},
+        {Name: 'Barbados', code: 'BB'},
+        {Name: 'Belarus', code: 'BY'},
+        {Name: 'Belgium', code: 'BE'},
+        {Name: 'Belize', code: 'BZ'},
+        {Name: 'Benin', code: 'BJ'},
+        {Name: 'Bermuda', code: 'BM'},
+        {Name: 'Bhutan', code: 'BT'},
+        {Name: 'Bolivia', code: 'BO'},
+        {Name: 'Bonaire, Sint Eustatius and Saba', code: 'BQ'},
+        {Name: 'Bosnia and Herzegovina ', code: 'BA'},
+        {Name: 'Bostwana', code: 'BW'},
+        {Name: 'Bouvet Island', code: 'BV'},
+        {Name: 'Brazil', code: 'BR'},
+        {Name: 'British Indian Ocean Territory', code: 'IO'},
+        {Name: 'Brunei Darussalam ', code: 'BN'},
+        {Name: 'Bulgaria', code: 'BG'},
+        {Name: 'Burkina Faso', code: 'BF'},
+        {Name: 'Burundi', code: 'BI'},
+        {Name: 'Cabo Verde', code: 'CV'},
+        {Name: 'Cambodia', code: 'KH'},
+        {Name: 'Cameroon', code: 'CM'},
+        {Name: 'Canada', code: 'CA'},
+        {Name: 'Cayman Islands', code: 'KY'},
+        {Name: 'Central African Republic', code: 'CF'},
+        {Name: 'Chad', code: 'TD'},
+        {Name: 'Chile', code: 'CL'},
+        {Name: 'China', code: 'CN'},
+        {Name: 'Christmas Island ', code: 'CX'},
+        {Name: 'Cocos(Keeling) Islands', code: 'CC'},
+        {Name: 'Columbia', code: 'CO'},
+        {Name: 'Comoros', code: 'KM'},
+        {Name: 'Congo, The Democratic Republic of the', code: 'CD'},
+        {Name: 'Congo', code: 'CG'},
+        {Name: 'Cook Islands', code: 'CK'},
+        {Name: 'Costa Rica', code: 'CR'},
+        {Name: 'Croatia', code: 'HR'},
+        {Name: 'Cuba', code: 'CU'},
+        {Name: 'Curaçao', code: 'CW'},
+        {Name: 'Cyprus', code: 'CY'},
+        {Name: 'Czechia', code: 'CZ'},
+        {Name: 'Côte d\'Ivoire', code: 'CI'},
+        {Name: 'Denmark', code: 'DK'},
+        {Name: 'Djibouti', code: 'DJ'},
+        {Name: 'Dominica', code: 'DM'},
+        {Name: 'Dominican Republic', code: 'DO'},
+        {Name: 'Ecuador', code: 'EC'},
+        {Name: 'Egypt', code: 'EG'},
+        {Name: 'El Salvador', code: 'SV'},
+        {Name: 'Equatorial Guinea ', code: 'GQ'},
+        {Name: 'Eritrea', code: 'ER'},
+        {Name: 'Estonia', code: 'EE'},
+        {Name: 'Eswatini', code: 'SZ'},
+        {Name: 'Ethiopia', code: 'ET'},
+        {Name: 'Falkland Islands (Malvinas)', code: 'FK'},
+        {Name: 'Faroe Islands', code: 'FO'},
+        {Name: 'Fiji', code: 'FJ'},
+        {Name: 'Finland', code: 'FI'},
+        {Name: 'France', code: 'FR'},
+        {Name: 'French Guiana', code: 'GF'},
+        {Name: 'French Polynesia', code: 'PF'},
+        {Name: 'French Southern Territories', code: 'TF'},
+        {Name: 'Gabon', code: 'GA'},
+        {Name: 'Gambia, The', code: 'GM'},
+        {Name: 'Georgia', code: 'GE'},
+        {Name: 'Germany', code: 'DE'},
+        {Name: 'Ghana', code: 'GH'},
+        {Name: 'Gibraltar', code: 'GI'},
+        {Name: 'Greece', code: 'GR'},
+        {Name: 'Greenland', code: 'GL'},
+        {Name: 'Grenada', code: 'GD'},
+        {Name: 'Guadeloupe', code: 'GP'},
+        {Name: 'Guam', code: 'GU'},
+        {Name: 'Guatemala', code: 'GT'},
+        {Name: 'Guernsey', code: 'GG'},
+        {Name: 'Guinea', code: 'GN'},
+        {Name: 'Guinea-Bissau', code: 'GW'},
+        {Name: 'Guyana', code: 'GY'},
+        {Name: 'Haiti', code: 'HT'},
+        {Name: 'Heard Island and McDonald Islands', code: 'HM'},
+        {Name: 'Holy See', code: 'VA'},
+        {Name: 'Honduras', code: 'HN'},
+        {Name: 'Hong Kong', code: 'HK'},
+        {Name: 'Hungary', code: 'HU'},
+        {Name: 'Iceland', code: 'IS'},
+        {Name: 'India', code: 'IN'},
+        {Name: 'Indonesia', code: 'ID'},
+        {Name: 'Iran, Islamic Republic of', code: 'IR'},
+        {Name: 'Iraq', code: 'IQ'},
+        {Name: 'Ireland', code: 'IE'},
+        {Name: 'Isle of Man', code: 'IM'},
+        {Name: 'Israel', code: 'IL'},
+        {Name: 'Italy', code: 'IT'},
+        {Name: 'Jamaica', code: 'JM'},
+        {Name: 'Japan', code: 'JP'},
+        {Name: 'Jersey', code: 'JE'},
+        {Name: 'Jordan', code: 'JO'},
+        {Name: 'Kazakhstan', code: 'KZ'},
+        {Name: 'Kenya', code: 'KE'},
+        {Name: 'Kiribati', code: 'KI'},
+        {Name: 'Korea, Republic of', code: 'KR'},
+        {Name: 'Korea, Democratic People\'s Republic of', code: 'KP'},
+        {Name: 'Kuwait', code: 'KW'},
+        {Name: 'Kyrgyzstan', code: 'KG'},
+        {Name: 'Lao People\'s Democratic Republic', code: 'LA'},
+        {Name: 'Latvia', code: 'LV'},
+        {Name: 'Lebanon', code: 'LB'},
+        {Name: 'Lesotho', code: 'LS'},
+        {Name: 'Liberia', code: 'LR'},
+        {Name: 'Libya', code: 'LY'},
+        {Name: 'Liechtenstein', code: 'LI'},
+        {Name: 'Lithuania', code: 'LT'},
+        {Name: 'Luxembourg', code: 'LU'},
+        {Name: 'Macao', code: 'MO'},
+        {Name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK'},
+        {Name: 'Madagascar', code: 'MG'},
+        {Name: 'Malawi', code: 'MW'},
+        {Name: 'Malaysia', code: 'MY'},
+        {Name: 'Maldives', code: 'MV'},
+        {Name: 'Mali', code: 'ML'},
+        {Name: 'Malta', code: 'MT'},
+        {Name: 'Marshall Islands', code: 'MH'},
+        {Name: 'Martinique', code: 'MQ'},
+        {Name: 'Mauritania', code: 'MR'},
+        {Name: 'Mauritius', code: 'MU'},
+        {Name: 'Mayotte', code: 'YT'},
+        {Name: 'Mexico', code: 'MX'},
+        {Name: 'Micronesia, Federated States of', code: 'FM'},
+        {Name: 'Moldova, Republic of', code: 'MD'},
+        {Name: 'Monaco', code: 'MC'},
+        {Name: 'Mongolia', code: 'MN'},
+        {Name: 'Montenegro', code: 'ME'},
+        {Name: 'Montserrat', code: 'MS'},
+        {Name: 'Morocco', code: 'MA'},
+        {Name: 'Mozambique', code: 'MZ'},
+        {Name: 'Myanmar', code: 'MM'},
+        {Name: 'Namibia', code: 'NA'},
+        {Name: 'Nauru', code: 'NR'},
+        {Name: 'Nepal', code: 'NP'},
+        {Name: 'Netherlands', code: 'NL'},
+        {Name: 'New Caledonia', code: 'NC'},
+        {Name: 'New Zealand', code: 'NZ'},
+        {Name: 'Nicaragua', code: 'NI'},
+        {Name: 'Niger', code: 'NE'},
+        {Name: 'Nigeria', code: 'NG'},
+        {Name: 'Niue', code: 'NU'},
+        {Name: 'Norfolk Island', code: 'NF'},
+        {Name: 'Northern Mariana Islands', code: 'MP'},
+        {Name: 'Norway', code: 'NO'},
+        {Name: 'Oman', code: 'OM'},
+        {Name: 'Pakistan', code: 'PK'},
+        {Name: 'Palau', code: 'PW'},
+        {Name: 'Palestine', code: 'PS'},
+        {Name: 'Panama', code: 'PA'},
+        {Name: 'Papua New Guinea', code: 'PG'},
+        {Name: 'Paraguay', code: 'PY'},
+        {Name: 'Peru', code: 'PE'},
+        {Name: 'Philippines', code: 'PH'},
+        {Name: 'Pitcairn', code: 'PN'},
+        {Name: 'Poland', code: 'PL'},
+        {Name: 'Portugal', code: 'PT'},
+        {Name: 'Puerto Rico', code: 'PR'},
+        {Name: 'Qatar', code: 'QA'},
+        {Name: 'Romania', code: 'RO'},
+        {Name: 'Russian Federation', code: 'RU'},
+        {Name: 'Rwanda', code: 'RW'},
+        {Name: 'Réunion', code: 'RE'},
+        {Name: 'Saint Barthélemy', code: 'BL'},
+        {Name: 'Saint Helena, Ascension and Tristan da Cunha', code: 'SH'},
+        {Name: 'Saint Kitts and Nevis ', code: 'KN'},
+        {Name: 'Saint Lucia', code: 'LC'},
+        {Name: 'Saint Martin', code: 'MF'},
+        {Name: 'Saint Pierre and Miquelon', code: 'PM'},
+        {Name: 'Saint Vincent and the Grenadines', code: 'VC'},
+        {Name: 'Samoa', code: 'WS'},
+        {Name: 'San Marino ', code: 'SM'},
+        {Name: 'Sao Tome and Principe', code: 'ST'},
+        {Name: 'Saudi Arabia', code: 'SA'},
+        {Name: 'Senegal', code: 'SN'},
+        {Name: 'Serbia', code: 'RS'},
+        {Name: 'Seychelles', code: 'SC'},
+        {Name: 'Sierra Leone', code: 'SL'},
+        {Name: 'Singapore', code: 'SG'},
+        {Name: 'Sint Maarten', code: 'SX'},
+        {Name: 'Slovakia', code: 'SK'},
+        {Name: 'Slovenia', code: 'SI'},
+        {Name: 'Solomon Islands', code: 'SB'},
+        {Name: 'Somalia', code: 'SO'},
+        {Name: 'South Africa ', code: 'ZA'},
+        {Name: 'South Georgia and the South Sandwich Islands', code: 'GS'},
+        {Name: 'South Sudan', code: 'SS'},
+        {Name: 'Spain', code: 'ES'},
+        {Name: 'Sri Lanka', code: 'LK'},
+        {Name: 'Sudan', code: 'SD'},
+        {Name: 'Suriname', code: 'SR'},
+        {Name: 'Svalbard and Jan Mayen', code: 'SJ'},
+        {Name: 'Sweden', code: 'SE'},
+        {Name: 'Switzerland', code: 'CH'},
+        {Name: 'Syrian Arab Republic', code: 'SY'},
+        {Name: 'Taiwan', code: 'TW'},
+        {Name: 'Tajikistan', code: 'TJ'},
+        {Name: 'Tanzania, United Republic of', code: 'TZ'},
+        {Name: 'Thailand', code: 'TH'},
+        {Name: 'Timor-Leste', code: 'TL'},
+        {Name: 'Togo', code: 'TG'},
+        {Name: 'Tokelau', code: 'TK'},
+        {Name: 'Tonga', code: 'TO'},
+        {Name: 'Trinidad and Tobago', code: 'TT'},
+        {Name: 'Tunisia', code: 'TN'},
+        {Name: 'Turkey', code: 'TR'},
+        {Name: 'Turkmenistan', code: 'TM'},
+        {Name: 'Turks and Caicos Islands', code: 'TC'},
+        {Name: 'Tuvalu', code: 'TV'},
+        {Name: 'Uganda', code: 'UG'},
+        {Name: 'Ukraine', code: 'UA'},
+        {Name: 'United Arab Emirates', code: 'AE'},
+        {Name: 'United Kingdom', code: 'GB'},
+        {Name: 'United States Minor Outlying Islands', code: 'UM'},
+        {Name: 'United States of America', code: 'US'},
+        {Name: 'Uruguay', code: 'UY'},
+        {Name: 'Uzbekistan', code: 'UZ'},
+        {Name: 'Vanuatu', code: 'VU'},
+        {Name: 'Venezuela', code: 'VE'},
+        {Name: 'Viet Nam', code: 'VN'},
+        {Name: 'Virgin Islands, British', code: 'VG'},
+        {Name: 'Virgin Islands, U.S', code: 'VI'},
+        {Name: 'Wallis and Futuna', code: 'WF'},
+        {Name: 'Western Sahara', code: 'EH'},
+        {Name: 'Yemen', code: 'YE'},
+        {Name: 'Zambia', code: 'ZM'},
+        {Name: 'Zimbabwe', code: 'ZW'},
+        {Name: 'Åland Islands', code: 'AX'}
+      ],
       MESSAGES: {
         POLL: {
           HOST_ON_TIMEOUT: