CEC-749 Generate cert UI (#141)
* Add Create Certificate page * Tests * Update permission check * Use Azure
This commit is contained in:
50
src/components/Certificates/Add/DownloadCerts.jsx
Normal file
50
src/components/Certificates/Add/DownloadCerts.jsx
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Button } from "@material-ui/core";
|
||||
import React from "react";
|
||||
|
||||
import DownloadFileLink from "../../Controls/DownloadFileLink";
|
||||
import useStyles from "../../useStyles";
|
||||
|
||||
const CertMimeType = "application/x-pem-file";
|
||||
|
||||
const DownloadCerts = ({ vin, publicCert, privateCert, onChangeView }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
const onNewCert = (event) => {
|
||||
event.preventDefault();
|
||||
if (!onChangeView) return;
|
||||
onChangeView();
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<h2>Download Certifcates</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<DownloadFileLink
|
||||
data={publicCert}
|
||||
filename={`${vin}_cert.pem`}
|
||||
mimetype={CertMimeType}
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<DownloadFileLink
|
||||
data={privateCert}
|
||||
filename={`${vin}_key.pem`}
|
||||
mimetype={CertMimeType}
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<Button
|
||||
type="submit"
|
||||
fullWidth
|
||||
variant="contained"
|
||||
color="primary"
|
||||
className={classes.submit}
|
||||
onClick={onNewCert}
|
||||
>
|
||||
Done
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DownloadCerts;
|
||||
Reference in New Issue
Block a user