Files
server/util/Seeder/Factories/DriversLicenseCipherSeeder.cs
Nick Krantz 39a132d192 [PM-34116][PM-34117] Drivers License and Passport (#7512)
* update minimum version to handle all new item types rather than individual types

* add cipher types for driverslicense and passport

* add request and response models for DriversLicense and Passport

* add events for DriversLicense and Passport

* add seeder

* add additional properties from CXP

* add additional fields
2026-04-28 17:35:01 +00:00

30 lines
886 B
C#

using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Enums;
using Bit.Seeder.Models;
namespace Bit.Seeder.Factories;
internal static class DriversLicenseCipherSeeder
{
internal static Cipher Create(
string encryptionKey,
string name,
DriversLicenseViewDto driversLicense,
Guid? organizationId = null,
Guid? userId = null,
string? notes = null)
{
var cipherView = new CipherViewDto
{
OrganizationId = organizationId,
Name = name,
Notes = notes,
Type = CipherTypes.DriversLicense,
DriversLicense = driversLicense
};
var encrypted = CipherEncryption.Encrypt(cipherView, encryptionKey);
return CipherEncryption.CreateEntity(encrypted, encrypted.ToDriversLicenseData(), CipherType.DriversLicense, organizationId, userId);
}
}