import type { ICredentialType, INodeProperties, Icon, ThemeIconColor } from 'n8n-workflow';

export class Crypto implements ICredentialType {
	name = 'crypto';

	displayName = 'Crypto';

	documentationUrl = 'crypto';

	icon: Icon = 'fa:key';

	iconColor: ThemeIconColor = 'green';

	properties: INodeProperties[] = [
		{
			displayName: 'Hmac Secret',
			name: 'hmacSecret',
			type: 'string',
			description: 'Secret used in the Hmac action',
			typeOptions: {
				password: true,
			},
			default: '',
		},
		{
			displayName: 'Private Key',
			name: 'signPrivateKey',
			type: 'string',
			description: 'Private Key used in the Sign action',
			typeOptions: {
				rows: 4,
				password: true,
			},
			default: '',
		},
		{
			displayName: 'Encryption Passphrase',
			name: 'encryptionPassphrase',
			type: 'string',
			description:
				'Passphrase for symmetric Encrypt/Decrypt. Use 16+ random characters or a strong passphrase generated by a password manager.',
			typeOptions: {
				password: true,
			},
			default: '',
		},
		{
			displayName: 'Encryption Public Key',
			name: 'encryptionPublicKey',
			type: 'string',
			description:
				'RSA public key (PEM, SPKI format) used by Encrypt in asymmetric mode. RSA-OAEP-SHA256 can only encrypt small payloads (~190 bytes with a 2048-bit key); use symmetric mode for larger data.',
			typeOptions: {
				rows: 4,
				password: true,
			},
			default: '',
		},
		{
			displayName: 'Encryption Private Key',
			name: 'encryptionPrivateKey',
			type: 'string',
			description: 'RSA private key (PEM, PKCS#8 format) used by Decrypt in asymmetric mode',
			typeOptions: {
				rows: 4,
				password: true,
			},
			default: '',
		},
	];
}
