A little fix to signature verification methods doc
This commit is contained in:
parent
626e59c68d
commit
73a9b87607
2 changed files with 4 additions and 2 deletions
|
|
@ -76,7 +76,8 @@ module DiasporaFederation
|
|||
end
|
||||
|
||||
# Verifies the signatures (+author_signature+ and +parent_author_signature+ if needed).
|
||||
# @raise [SignatureVerificationFailed] if the signature is not valid or no public key is found
|
||||
# @raise [SignatureVerificationFailed] if the signature is not valid
|
||||
# @raise [PublicKeyNotFound] if no public key is found
|
||||
def verify_signatures
|
||||
verify_signature(author, :author_signature)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ module DiasporaFederation
|
|||
#
|
||||
# @param [String] author The author of the signature
|
||||
# @param [String] signature_key The signature to be verified
|
||||
# @return [Boolean] signature valid
|
||||
# @raise [SignatureVerificationFailed] if the signature is not valid
|
||||
# @raise [PublicKeyNotFound] if no public key is found
|
||||
def verify_signature(author, signature_key)
|
||||
pubkey = DiasporaFederation.callbacks.trigger(:fetch_public_key, author)
|
||||
raise PublicKeyNotFound, "signature=#{signature_key} person=#{author} obj=#{self}" if pubkey.nil?
|
||||
|
|
|
|||
Loading…
Reference in a new issue