Exemple #1
0
 public Anonymous_C5(DecryptorV2 paramouter_DecryptorV2,
                     net.named_data.jndn.encrypt.EncryptError.OnError onError_0, DecryptorV2.ContentKey contentKey_1)
 {
     this.onError           = onError_0;
     this.contentKey        = contentKey_1;
     this.outer_DecryptorV2 = paramouter_DecryptorV2;
 }
Exemple #2
0
 public Anonymous_C2(DecryptorV2 paramouter_DecryptorV2, Name kdkPrefix_0,
                     net.named_data.jndn.encrypt.EncryptError.OnError onError_1, DecryptorV2.ContentKey contentKey_2, Data ckData_3)
 {
     this.kdkPrefix         = kdkPrefix_0;
     this.onError           = onError_1;
     this.contentKey        = contentKey_2;
     this.ckData            = ckData_3;
     this.outer_DecryptorV2 = paramouter_DecryptorV2;
 }
Exemple #3
0
 public Anonymous_C4(DecryptorV2 paramouter_DecryptorV2,
                     net.named_data.jndn.encrypt.EncryptError.OnError onError_0, int nTriesLeft_1, DecryptorV2.ContentKey contentKey_2,
                     Name ckName_3)
 {
     this.onError           = onError_0;
     this.nTriesLeft        = nTriesLeft_1;
     this.contentKey        = contentKey_2;
     this.ckName            = ckName_3;
     this.outer_DecryptorV2 = paramouter_DecryptorV2;
 }
Exemple #4
0
            public void onData(Interest ckInterest, Data ckData)
            {
                try {
                    contentKey.pendingInterest = 0;
                    // TODO: Verify that the key is legitimate.
                    Name[] kdkPrefix       = new Name[1];
                    Name[] kdkIdentityName = new Name[1];
                    Name[] kdkKeyName      = new Name[1];
                    if (!DecryptorV2.extractKdkInfoFromCkName(ckData.getName(),
                                                              ckInterest.getName(), onError,
                                                              kdkPrefix, kdkIdentityName, kdkKeyName))
                    {
                        // The error has already been reported.
                        return;
                    }

                    // Check if the KDK already exists.
                    PibIdentity kdkIdentity = null;
                    try {
                        kdkIdentity = outer_DecryptorV2.internalKeyChain_.getPib()
                                      .getIdentity(kdkIdentityName[0]);
                    } catch (Pib.Error ex) {
                    }
                    if (kdkIdentity != null)
                    {
                        PibKey kdkKey = null;
                        try {
                            kdkKey = kdkIdentity
                                     .getKey(kdkKeyName[0]);
                        } catch (Pib.Error ex_0) {
                        }
                        if (kdkKey != null)
                        {
                            // The KDK was already fetched and imported.
                            net.named_data.jndn.encrypt.DecryptorV2.logger_.log(
                                ILOG.J2CsMapping.Util.Logging.Level.INFO,
                                "KDK {0} already exists, so directly using it to decrypt the CK",
                                kdkKeyName);
                            outer_DecryptorV2.decryptCkAndProcessPendingDecrypts(
                                contentKey, ckData,
                                kdkKeyName[0], onError);
                            return;
                        }
                    }

                    outer_DecryptorV2.fetchKdk(contentKey, kdkPrefix[0], ckData,
                                               onError, net.named_data.jndn.encrypt.EncryptorV2.N_RETRIES);
                } catch (Exception ex_1) {
                    onError.onError(net.named_data.jndn.encrypt.EncryptError.ErrorCode.General,
                                    "Error in fetchCk onData: " + ex_1);
                }
            }