> ## Documentation Index
> Fetch the complete documentation index at: https://trustos.telefonicatech.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# File Hash

> Generates the double hash of a file.

This SHA-256 hash value serves as a unique and tamper-proof digital fingerprint for the file, providing a means of verifying its integrity and authenticity.

The hash value generated by the API can be compared to the hash value **(you can obtain this value with the functions provided [here](/cert/hashing-method))** of the original file to ensure that the file has not been altered or corrupted. The hash value can also be used as a means of verifying the authenticity and provenance of the file over time, as any changes or modifications to the file will result in a different hash value.


## OpenAPI

````yaml post /file-hash
openapi: 3.0.1
info:
  title: TrustOS EVM Cert API
  description: >-
    TrustOS EVM Cert API is used to interact with EVM based blockchain networks.
    In case you have some questions or need more about the use of this API,
    don't hesitate to contact B-Team:
  contact:
    name: Blockchain Team
    email: soporte-bteam@telefonica.com
  version: 2.6.0
servers:
  - url: https://lab.trustos.telefonicatech.com/cert/v2
    description: Lab
security: []
tags:
  - name: Certificate Generation
    description: Methods for generating certificates.
  - name: Certificate Management
    description: Basic methods about certificates.
  - name: Qualified Signature
    description: Methods for generating qualified signatures.
  - name: Utils
    description: Methods for specific use cases.
paths:
  /file-hash:
    post:
      tags:
        - Utils
      summary: Get file hash.
      requestBody:
        description: Data needed for the file hash.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                fileInput:
                  type: string
                  format: binary
                  description: File which will be hashed.
        required: true
      responses:
        '200':
          $ref: '#/components/responses/200-FileHashGenerated'
        '400':
          $ref: '#/components/responses/400-ValidationError'
        '401':
          $ref: '#/components/responses/401-AuthenticationError'
        '500':
          $ref: '#/components/responses/500-InternalServerError'
      security:
        - bearerAuth: []
components:
  responses:
    200-FileHashGenerated:
      description: Successful file hash generation.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
                description: Request status code.
                example: 200
              message:
                type: string
                description: Message returned by the request.
                example: File hash generated
              data:
                type: object
                description: Data returned by the request.
                properties:
                  fileHash:
                    type: string
                    description: Double hash of the file.
                    example: >-
                      eef10adc293b31c8266a6d8f766581e77ea01273a8e0e3f6a688ed0672fea308
    400-ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 400
              type:
                type: string
                description: Type of the error.
                example: Validation Error
              message:
                type: string
                description: Message returned by the request.
                example: Request parameters are wrong, check requirements
              errors:
                type: array
                description: All the validation errors encountered in the request.
                items:
                  type: object
                  properties:
                    field:
                      type: string
                      description: Name of the field.
                      example: ''
                    error:
                      type: string
                      description: Description of the error encountered.
                      example: ''
    401-AuthenticationError:
      description: Authentication error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 401
              type:
                type: string
                description: Type of the error.
                example: Authentication Error
              message:
                type: string
                description: Message returned by the request.
                enum:
                  - User credentials are wrong
                  - Token is invalid
                  - Token is expired
                  - Token is not provided
    500-InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 500
              type:
                type: string
                description: Type of the error.
                example: Internal Server Error
              message:
                type: string
                description: Message returned by the request.
                example: Oops! Something went wrong, please try again later
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````