Skip to content

Commit

Permalink
Merge branch 'main' into fix/did-indy-diddoc-content
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris authored Sep 12, 2024
2 parents a58cc9a + 4c1108c commit 44e72e9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/core/src/modules/x509/__tests__/X509Service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,24 @@ describe('X509Service', () => {
})
})

it('should generate a self-signed X509 Certificate', async () => {
it('should generate a self-signed X509 Certificate with Ed25519', async () => {
const key = await agentContext.wallet.createKey({ keyType: KeyType.Ed25519 })

const selfSignedCertificate = await X509Service.createSelfSignedCertificate(agentContext, {
key,
})

expect(selfSignedCertificate.publicKey.publicKeyBase58).toStrictEqual(key.publicKeyBase58)
expect(selfSignedCertificate.sanDnsNames).toStrictEqual([])
expect(selfSignedCertificate.sanUriNames).toStrictEqual([])

const pemCertificate = selfSignedCertificate.toString('pem')

expect(pemCertificate.startsWith('-----BEGIN CERTIFICATE-----\n')).toBeTruthy()
expect(pemCertificate.endsWith('\n-----END CERTIFICATE-----')).toBeTruthy()
})

it('should generate a self-signed X509 Certificate with P256', async () => {
const key = await agentContext.wallet.createKey({ keyType: KeyType.P256 })

const selfSignedCertificate = await X509Service.createSelfSignedCertificate(agentContext, {
Expand Down

0 comments on commit 44e72e9

Please sign in to comment.