use of org.sagebionetworks.bridge.models.CmsPublicKey in project BridgeServer2 by Sage-Bionetworks.
the class AppControllerTest method canGetCmsPublicKeyPemFile.
@Test
public void canGetCmsPublicKeyPemFile() throws Exception {
doReturn(mockSession).when(controller).getAuthenticatedSession(DEVELOPER);
CmsPublicKey result = controller.getAppPublicKeyAsPem();
assertTrue(result.getPublicKey().contains("-----BEGIN CERTIFICATE-----"));
}
use of org.sagebionetworks.bridge.models.CmsPublicKey in project BridgeServer2 by Sage-Bionetworks.
the class AppController method getAppPublicKeyAsPem.
@GetMapping(path = { "/v1/apps/self/publicKey", "/v3/studies/self/publicKey" })
public CmsPublicKey getAppPublicKeyAsPem() {
UserSession session = getAuthenticatedSession(DEVELOPER);
String pem = uploadCertificateService.getPublicKeyAsPem(session.getAppId());
return new CmsPublicKey(pem);
}
Aggregations