| Return the key if it's valid, and throw an error otherwise.
validateProxySecretKey
    :: (MonadError Text m, Bi w)
    => ProtocolMagic
    -> ProxySecretKey w
    -> m ()
validateProxySecretKey pm psk =
    if verifyProxyCert pm (pskIssuerPk psk) (pskDelegatePk psk)
                          (pskOmega psk) (pskCert psk)
        then pure ()
        else throwError "a ProxySecretKey has an invalid signature"

v
validateProxySecretKey
    :: (MonadError Text m, Bi w)
    => ProtocolMagic
    -> ProxySecretKey w
    -> m ()
validateProxySecretKey pm psk =
    if verifyProxyCert pm (pskIssuerPk psk) (pskDelegatePk psk)
                          (pskOmega psk) (pskCert psk)
        then pure ()
        else throwError "a ProxySecretKey has an invalid signature"
validateProxySecretKey pm psk =
    if verifyProxyCert pm (pskIssuerPk psk) (pskDelegatePk psk)
                          (pskOmega psk) (pskCert psk)
        then pure ()
        else throwError "a ProxySecretKey has an invalid signature"