Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/trusty/trusty/user/app/avb/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 2 kB image not shown  

Quelle  secure_storage_interface.h

  Sprache: C
 

/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef SECURE_STORAGE_H_
#define SECURE_STORAGE_H_

#include <stddef.h>
#include <stdint.h>

namespace avb {

// Abstract interface for secure storage.
class SecureStorageInterface {
public:
    SecureStorageInterface() = default;
    virtual ~SecureStorageInterface() = default;

    // SecureStorageInterface is neither copyable nor moveable
    SecureStorageInterface(const SecureStorageInterface&) = delete;
    SecureStorageInterface& operator=(const SecureStorageInterface&) = delete;

    // Opens a file in secure storage named |filename|.
    //
    // Returns NO_ERROR on success, negative error code on failure.
    virtual int open(const char* filename) = 0;

    // Deletes a file in secure storage named |filename|.
    //
    // Returns NO_ERROR on success, negative error code on failure.
    virtual int delete_file(const char* filename) = 0;

    // Reads |size| bytes into |buf| from the file starting at offset |off|. The
    // file must have been previously opened by open().
    //
    // Returns number of bytes read on success, negative error code on failure.
    virtual int read(uint64_t off, void* buf, size_t size) const = 0;

    // Gets the size of the file in secure storage previously opened with open()
    // and stores it in |size|.
    //
    // Returns NO_ERROR on success, negative error code on failure.
    virtual int get_file_size(uint64_t* size) const = 0;

    // Writes |size| bytes from |buf| into the file starting at offset |off|.
    // The file must have been previously opened by open().
    //
    // Returns number of bytes written on succes, negative error code on
    // failure.
    virtual int write(uint64_t off, const void* buf, size_t size) const = 0;
};

}  // namespace avb

#endif  // SECURE_STORAGE_H_

Messung V0.5 in Prozent
C=91 H=97 G=93

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.