github.com/Consensys/quorum@v21.1.0+incompatible/plugin/online_verifier.go (about)

     1  package plugin
     2  
     3  // Implementation of plugin.Verifier that uses remote server to verify plugins.
     4  type OnlineVerifier struct {
     5  	centralClient *CentralClient
     6  }
     7  
     8  func NewOnlineVerifier(centralClient *CentralClient) *OnlineVerifier {
     9  	return &OnlineVerifier{centralClient: centralClient}
    10  }
    11  
    12  // Verify a plugin giving its name from Central
    13  func (v *OnlineVerifier) VerifySignature(definition *PluginDefinition, checksum string) error {
    14  	sig, err := v.centralClient.PluginSignature(definition)
    15  	if err != nil {
    16  		return err
    17  	}
    18  	pubkey, err := v.centralClient.PublicKey()
    19  	if err != nil {
    20  		return err
    21  	}
    22  	return verify(sig, pubkey, checksum)
    23  }