import { Injectable } from '@nestjs/common' ; import { Observable , ReplaySubject } from 'rxjs' ; @ Injectable ( ) export class CertSubscribeService { private readonly publicKey = new ReplaySubject < string > ( 1 ) ; public getCert ( ) { return this . publicKey . asObservable ( ) ; } public setCert ( key ) { this . publicKey . next ( key ) ; } }