Skip to content

Commit a97f464

Browse files
committed
fix: change method name
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
1 parent 673ef32 commit a97f464

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/controllers/x509/crypto-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function pemToRawEcPrivateKey(pem: string): Promise<string> {
2222
/**
2323
* Extracts the raw private key (hex) from a PEM-encoded Ed25519 private key.
2424
*/
25-
export async function pemToRawEd25519PrivateKey(derKey: string | Buffer): Promise<string> {
25+
export async function pemToRawPrivateKey(derKey: string | Buffer): Promise<string> {
2626
// If it's a base64 string, convert to Buffer
2727
const keyBuffer = typeof derKey === 'string' ? Buffer.from(derKey, 'base64') : derKey
2828

src/controllers/x509/x509.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs'
1818
import { keyAlgorithmToCurve } from '../../utils/constant'
1919
import { generateSecretKey, getCertificateValidityForSystem, getTypeFromCurve } from '../../utils/helpers'
2020

21-
import { pemToRawEd25519PrivateKey } from './crypto-util'
21+
import { pemToRawPrivateKey } from './crypto-util'
2222
import { type X509CreateCertificateOptionsDto } from './x509.types'
2323

2424
class x509Service {
@@ -131,7 +131,7 @@ class x509Service {
131131
const agent = agentReq.agent
132132
if (!options.privateKey) throw new Error('[ImportX509Certificates] privateKey is required')
133133
agent.config.logger.debug(`Start validating keys`)
134-
const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey)
134+
const secretHexKey = await pemToRawPrivateKey(options.privateKey)
135135
const privateKey = TypedArrayEncoder.fromHex(secretHexKey)
136136

137137
agent.config.logger.debug(`Decode certificate`)

0 commit comments

Comments
 (0)