Ejemplo n.º 1
0
        /// <summary>
        /// Create a Producer to use the given ProducerDb, Face and other values.
        /// A producer can produce data with a naming convention:
        /// /{prefix}/SAMPLE/{dataType}/[timestamp]
        /// The produced data packet is encrypted with a content key,
        /// which is stored in the ProducerDb database.
        /// A producer also needs to produce data containing a content key
        /// encrypted with E-KEYs. A producer can retrieve E-KEYs through the face,
        /// and will re-try for at most 3 times when E-KEY retrieval fails.
        /// </summary>
        ///
        /// <param name="prefix">The producer name prefix.</param>
        /// <param name="dataType">The dataType portion of the producer name.</param>
        /// <param name="face">The face used to retrieve keys.</param>
        /// <param name="keyChain">The keyChain used to sign data packets.</param>
        /// <param name="database">The ProducerDb database for storing keys.</param>
        public Producer(Name prefix, Name dataType, Face face, KeyChain keyChain,
                        ProducerDb database)
        {
            this.eKeyInfo_     = new Hashtable();
            this.keyRequests_  = new Hashtable();
            face_              = face;
            keyChain_          = keyChain;
            database_          = database;
            maxRepeatAttempts_ = 3;

            construct(prefix, dataType);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a Producer to use the given ProducerDb, Face and other values.
        /// A producer can produce data with a naming convention:
        /// /{prefix}/SAMPLE/{dataType}/[timestamp]
        /// The produced data packet is encrypted with a content key,
        /// which is stored in the ProducerDb database.
        /// A producer also needs to produce data containing a content key
        /// encrypted with E-KEYs. A producer can retrieve E-KEYs through the face,
        /// and will re-try for at most repeatAttemps times when E-KEY retrieval fails.
        /// </summary>
        ///
        /// <param name="prefix">The producer name prefix. This makes a copy of the Name.</param>
        /// <param name="dataType"></param>
        /// <param name="face">The face used to retrieve keys.</param>
        /// <param name="keyChain">The keyChain used to sign data packets.</param>
        /// <param name="database">The ProducerDb database for storing keys.</param>
        /// <param name="repeatAttempts">The maximum retry for retrieving keys.</param>
        /// <param name="keyRetrievalLink">getDelegations().size() is zero, don't use it.</param>
        public Producer(Name prefix, Name dataType, Face face, KeyChain keyChain,
                        ProducerDb database, int repeatAttempts, Link keyRetrievalLink)
        {
            this.eKeyInfo_     = new Hashtable();
            this.keyRequests_  = new Hashtable();
            face_              = face;
            keyChain_          = keyChain;
            database_          = database;
            maxRepeatAttempts_ = repeatAttempts;
            // Copy the Link object.
            keyRetrievalLink_ = new Link(keyRetrievalLink);

            construct(prefix, dataType);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a Producer to use the given ProducerDb, Face and other values.
        /// A producer can produce data with a naming convention:
        /// /{prefix}/SAMPLE/{dataType}/[timestamp]
        /// The produced data packet is encrypted with a content key,
        /// which is stored in the ProducerDb database.
        /// A producer also needs to produce data containing a content key
        /// encrypted with E-KEYs. A producer can retrieve E-KEYs through the face,
        /// and will re-try for at most repeatAttemps times when E-KEY retrieval fails.
        /// </summary>
        ///
        /// <param name="prefix">The producer name prefix. This makes a copy of the Name.</param>
        /// <param name="dataType"></param>
        /// <param name="face">The face used to retrieve keys.</param>
        /// <param name="keyChain">The keyChain used to sign data packets.</param>
        /// <param name="database">The ProducerDb database for storing keys.</param>
        /// <param name="repeatAttempts">The maximum retry for retrieving keys.</param>
        public Producer(Name prefix, Name dataType, Face face, KeyChain keyChain,
				ProducerDb database, int repeatAttempts)
        {
            this.eKeyInfo_ = new Hashtable();
                    this.keyRequests_ = new Hashtable();
            face_ = face;
            keyChain_ = keyChain;
            database_ = database;
            maxRepeatAttempts_ = repeatAttempts;

            construct(prefix, dataType);
        }