Skip to content

Commit

Permalink
feat: Add CMS Encryption option to certificate profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Jan 22, 2025
1 parent 8e5d754 commit 52a83b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CaIssueCertificateView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ export const CaIssueCertificateView: React.FC<CaIssueCertificateViewProps> = ()
<MenuItem value="code_signing">Code Signing</MenuItem>
<MenuItem value="smime">S/MIME</MenuItem>
<MenuItem value="pdf_signing">PDF Document Signing</MenuItem>
<MenuItem value="cms_encryption">CMS Encryption</MenuItem>
</Select>
</FormControl>
</ListItem>
Expand Down
6 changes: 5 additions & 1 deletion src/CaProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class CaDataBase {
}
}

export type CertificateProfile = 'none' | 'code_signing' | 'smime' | 'pdf_signing';
export type CertificateProfile = 'none' | 'code_signing' | 'smime' | 'pdf_signing' | 'cms_encryption';

export interface CaEnrolParams {
subject: string;
Expand Down Expand Up @@ -234,6 +234,10 @@ export const CaProvider: React.FC<CaProviderProps> = (params) => {
extensions.push(new x509.KeyUsagesExtension(x509.KeyUsageFlags.digitalSignature, true));
extensions.push(new x509.ExtendedKeyUsageExtension(['1.2.840.113583.1.1.10'])); // Adobe PDF
break;
case 'cms_encryption':
extensions.push(new x509.KeyUsagesExtension(x509.KeyUsageFlags.keyEncipherment | x509.KeyUsageFlags.dataEncipherment, true));
extensions.push(new x509.ExtendedKeyUsageExtension(['1.3.6.1.4.1.311.80.1'])); // Document Encryption
break;
default:
extensions.push(new x509.KeyUsagesExtension(x509.KeyUsageFlags.digitalSignature, true));
break;
Expand Down

0 comments on commit 52a83b1

Please sign in to comment.