magma / domain-proxy

A Domain proxy for Magma
BSD 3-Clause "New" or "Revised" License
1 stars 6 forks source link

[Single-Step-Registration] Implement cpi_digital_signature for type B radios #397

Open WojSad opened 2 years ago

WojSad commented 2 years ago

If the radio is of type B, its indoor_deployment=true and registration_method=single-step, we should create the radio with cpi_digital_signature field populated.

TODO: Check if the created radio is of type A and has indoor_deployment=true if so, proceed to generate the cpi_digital_signature as part of the server side CreateCbsdMethod.

digitalSignature is a string representing JOSE encrypted data that's used to encrypt installation data and to vouch for the CPI's identity.

It's made out of protectedHeader, encodedCpiSignedData and CPI's private key.

protectedHeader is a base64 encoded value determining the algorithm used to encrypt digitalSignature. For the purpose of Domain Proxy a JWT algorithm RS256 is used. The name of the algorithm needs to be stored in a config file.

encodedCpiSignedData is a base64 encoded value of the CpiSignedData object, which, in general, can be thought of as registrationRequest's payload.
It comprises fccId, cbsdSerialNumber, installationParam and professionalInstallerData.

installationParam contains: latitude longitude indoor_deployment height height_type horizontal_accuracy antenna_azimuth antenna_downtilt eirp_capability antenna_beamwidth antenna_model

professionalInstallerData contains: cpiName
installCertificationTime cpiId
cpiKey

All the above fields come in a POST request from the NMS form.

Values of protectedHeader and encodedCpiSignedData are connected with a dot . and encrypted using the algorithm specified inside protectedHeader and CPI's private key (sent in the cpiKey field). See https://jwt.io/introduction for details on how to encrypt the data.

The resulting string is the value of digitalSignature field.