376 references to Strings
NuGet.Packaging (376)
Core\NuspecCoreReaderBase.cs (1)
194Strings.MissingMetadataNode,
Core\NuspecUtility.cs (2)
77throw new PackagingException(Strings.MissingPackageTypeName); 92Strings.InvalidPackageTypeVersion,
Core\PackageDependency.cs (1)
63throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(id));
Core\PackageType.cs (1)
28throw new ArgumentException(Strings.StringCannotBeNullOrEmpty, nameof(name));
FallbackPackagePathResolver.cs (2)
57Strings.FallbackFolderNotFound, 111Strings.StringCannotBeNullOrEmpty,
Licenses\LicenseExpressionToken.cs (1)
26Value = value ?? throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(value)));
Licenses\LicenseExpressionTokenizer.cs (1)
26throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(value)));
Licenses\NuGetLicense.cs (7)
56throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_DeprecatedIdentifier, licenseIdentifier)); 68throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_DeprecatedIdentifier, licenseIdentifier)); 78string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(licenseIdentifier))); 103throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_IllegalUnlicensedOperator)); 109throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_UnexpectedIdentifier, licenseIdentifier)); 118throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_LicenseInvalidCharacters, licenseIdentifier)); 121throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_LicenseIdentifierIsException, licenseIdentifier));
Licenses\NuGetLicenseException.cs (4)
39throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_DeprecatedIdentifier, exceptionIdentifier)); 45throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_ExceptionIdentifierIsLicense, exceptionIdentifier)); 49throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidExceptionIdentifier, exceptionIdentifier)); 54throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(exceptionIdentifier)));
Licenses\NuGetLicenseExpressionParser.cs (10)
50throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidToken, token.Value)); 59throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidToken, token.Value)); 67throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidToken, token.Value)); 83throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_MismatchedParentheses)); 92throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidToken, token.Value)); 123throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_MismatchedParentheses)); 132throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidExpression)); 159throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidCharacters, expression)); 175throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidExpression)); 206throw new NuGetLicenseExpressionParsingException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_InvalidExpression));
MinClientVersionUtility.cs (2)
36string.Format(CultureInfo.CurrentCulture, Strings.PackageMinVersionNotSatisfied, 87throw new InvalidOperationException(Strings.UnableToParseClientVersion);
NupkgMetadata\NupkgMetadataFileFormat.cs (1)
66Strings.Error_LoadingHashFile,
NuspecReader.cs (9)
304Strings.InvalidNuspecEntry, 459Strings.NuGetLicense_InvalidLicenseExpressionVersion, 475Strings.NuGetLicense_LicenseElementMissingValue)); 494errors.Add(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_NonStandardIdentifier, string.Join(", ", invalidLicenseIdentifiers))); 502errors.Add(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicenseExpression_UnlicensedPackageWarning)); 527Strings.NuGetLicense_LicenseExpressionVersionTooHigh, 616Strings.InvalidNuspecEntry, 682Strings.ErrorInvalidPackageVersionForDependency, 696Strings.ErrorInvalidPackageVersionForDependency,
PackageArchiveReader.cs (7)
144throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture, Strings.InvalidPackageNupkg, filePath), ex); 163throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(path)); 186throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(nupkgFilePath)); 379Strings.ErrorUnableCheckPackageEntries), e); 442throw new SignatureException(Strings.SignedPackageNotSignedOnVerify); 453throw new SignatureException(NuGetLogCode.NU3008, Strings.SignaturePackageIntegrityFailure, GetIdentity()); 542throw new SignatureException(Strings.SignedPackageUnableToAccessSignature);
PackageCreation\Authoring\FrameworkAssemblyReference.cs (1)
16throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(assemblyName));
PackageCreation\Authoring\ManifestReader.cs (6)
189throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicense_InvalidLicenseType, type)); 194throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicense_MissingRequiredValue)); 208Strings.NuGetLicense_InvalidLicenseExpressionVersion, 232Strings.InvalidLicenseExppressionVersion_VersionTooHigh, 240throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture, Strings.NuGetLicense_InvalidLicenseType, type)); 369throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture, Strings.Error_InvalidTargetFramework, targetFrameworkName));
PackageCreation\Authoring\PackageBuilder.cs (7)
92string.Format(CultureInfo.CurrentCulture, Strings.ErrorManifestFileNotFound, path ?? "null")); 181string.Format(CultureInfo.CurrentCulture, Strings.ErrorInvalidTimestamp, value)); 507throw new PackagingException(NuGetLogCode.NU1012, string.Format(CultureInfo.CurrentCulture, Strings.MissingTargetPlatformVersionsFromDependencyGroups, string.Join(", ", frameworksMissingPlatformVersion.OrderBy(str => str)))); 530throw new PackagingException(NuGetLogCode.NU1012, string.Format(CultureInfo.CurrentCulture, Strings.MissingTargetPlatformVersionsFromReferenceGroups, string.Join(", ", frameworksMissingPlatformVersion.OrderBy(str => str)))); 559throw new PackagingException(NuGetLogCode.NU1012, string.Format(CultureInfo.CurrentCulture, Strings.MissingTargetPlatformVersionsFromFrameworkAssemblyReferences, string.Join(", ", frameworksMissingPlatformVersion.OrderBy(str => str)))); 569throw new PackagingException(NuGetLogCode.NU1012, string.Format(CultureInfo.CurrentCulture, Strings.MissingTargetPlatformVersionsFromFrameworkAssemblyGroups, string.Join(", ", frameworksMissingPlatformVersion.OrderBy(str => str)))); 775throw new PackagingException(NuGetLogCode.NU1012, string.Format(CultureInfo.CurrentCulture, Strings.MissingTargetPlatformVersionsFromIncludedFiles, string.Join(", ", itemsWithFrameworkMissingPlatformVersion.OrderBy(str => str))));
PackageExtraction\PackagePathHelper.cs (1)
114string.Format(CultureInfo.CurrentCulture, Strings.PropertyCannotBeNull, nameof(packageIdentity.Version)),
PackageExtraction\ZipArchiveExtensions.cs (1)
116Strings.FailedFileTime,
PackageExtractor.cs (15)
49throw new ArgumentException(Strings.PackageStreamShouldBeSeekable); 232throw new ArgumentException(Strings.PackageStreamShouldBeSeekable); 538Strings.ErrorUnableToDeleteFile, 562Strings.ErrorUnableToDeleteFile, 600Strings.ErrorPackageIdentityDoesNotMatch, 762Strings.ErrorUnableToDeleteFile, 866Strings.ErrorUnableToDeleteFile, 1068emptyListErrorMessage: Strings.Error_NoClientAllowList, 1069noMatchErrorMessage: Strings.Error_NoMatchingClientCertificate)); 1088Strings.Error_NoRepoAllowList, 1089Strings.Error_NoMatchingRepositoryCertificate)); 1142message.Message = policyContext.Policy == SignatureValidationMode.Require ? Strings.Error_RequireMode_UnsignedPackage : Strings.Error_RepositorySettings_UnsignedPackage; 1146message.Message = string.Format(CultureInfo.CurrentCulture, Strings.ExtractionLog_InformationPrefix, package.Id, package.Version, source, message.Message); 1157string.Format(CultureInfo.CurrentCulture, Strings.PackageSignatureVerificationLog, package, source, verifyResult.IsValid));
PackageFolderReader.cs (3)
74message.Append(Strings.Error_MissingNuspecFile); 75message.AppendFormat(CultureInfo.CurrentCulture, Strings.Message_Path, _root.FullName); 80throw new PackagingException(Strings.MultipleNuspecFiles);
PackagePathResolver.cs (2)
33string.Format(CultureInfo.CurrentCulture, Strings.StringCannotBeNullOrEmpty, nameof(rootDirectory)), 39string.Format(CultureInfo.CurrentCulture, Strings.MustContainAbsolutePath, nameof(rootDirectory), rootDirectory),
PackageReaderBase.cs (4)
475Strings.InvalidPackageFrameworkFolderName, 539throw new PackagingException(NuGetLogCode.NU5037, Strings.Error_MissingNuspecFile); 543throw new PackagingException(Strings.MultipleNuspecFiles); 562Strings.ErrorUnsafePackageEntry,
PackagesConfigReader.cs (6)
118Strings.ErrorInvalidMinClientVersion, 151Strings.ErrorNullOrEmptyPackageId)); 160Strings.ErrorInvalidPackageVersion, 170Strings.ErrorInvalidPackageVersion, 183Strings.ErrorInvalidAllowedVersions, 239Strings.ErrorDuplicatePackages,
PackagesConfigWriter.cs (11)
72Strings.FailToLoadPackagesConfig), ex); 123Strings.MinClientVersionAlreadyExist)); 187Strings.UnableToAddEntry)); 196Strings.PackageEntryAlreadyExist, entry.PackageIdentity.Id)); 227Strings.UnableToAddEntry)); 238Strings.PackageEntryNotExist, oldEntry.PackageIdentity.Id, oldEntry.PackageIdentity.Version)); 265Strings.UnableToAddEntry)); 343Strings.UnableToAddEntry)); 353Strings.PackageEntryNotExist, entry.PackageIdentity.Id, entry.PackageIdentity.Version)); 415Strings.PackagesNodeNotExist, _filePath)); 581Strings.FailToWritePackagesConfig,
Rules\InvalidUndottedFrameworkRule.cs (1)
58Strings.MissingMetadataNode,
Signing\Archive\EndOfCentralDirectoryRecord.cs (1)
109Strings.ErrorByteSignatureNotFound,
Signing\Archive\ReadOnlyBufferedStream.cs (3)
103throw new ArgumentException(Strings.StreamMustBeReadable, nameof(stream)); 108throw new ArgumentException(Strings.StreamMustBeSeekable, nameof(stream)); 171Strings.RangeOutOfBoundsForArray,
Signing\Archive\SignedPackageArchiveIOUtility.cs (18)
48throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOExtraRead); 53throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOInvalidRead); 88throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOExtraRead); 93throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOInvalidRead); 131throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(bytes)); 159throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOExtraRead); 164throw new ArgumentOutOfRangeException(nameof(position), Strings.SignedPackageArchiveIOInvalidRead); 207throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(bytes)); 253throw new SignatureException(NuGetLogCode.NU3005, Strings.MultiplePackageSignatureFiles); 275throw new InvalidDataException(Strings.ErrorInvalidPackageArchive); 280throw new SignatureException(NuGetLogCode.NU3005, Strings.NoPackageSignatureFile); 363throw new InvalidDataException(Strings.ErrorInvalidPackageArchive); 413Strings.InvalidPackageSignatureFileEntry, 414Strings.InvalidPackageSignatureFileEntryCentralDirectoryHeader); 425errorMessagePrefix: Strings.InvalidPackageSignatureFileEntry, 426errorMessageSuffix: Strings.InvalidPackageSignatureFileEntryCentralDirectoryHeader, 435Strings.InvalidPackageSignatureFileEntry, 436Strings.InvalidPackageSignatureFileEntryLocalFileHeader);
Signing\Archive\SignedPackageArchiveUtility.cs (4)
55throw new InvalidDataException(Strings.ErrorInvalidPackageArchive); 132throw new SignatureException(NuGetLogCode.NU3005, Strings.InvalidPackageSignatureFile); 450throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(reader)); 456throw new SignatureException(NuGetLogCode.NU3003, Strings.SignedPackageNotSignedOnVerify);
Signing\Authoring\RepositorySignPackageRequest.cs (3)
67throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 72throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 79throw new ArgumentException(Strings.NuGetPackageOwnersInvalidValue, nameof(packageOwners));
Signing\Authoring\SigningOptions.cs (3)
119throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(inputPackageFilePath)); 124throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(outputPackageFilePath)); 132Strings.SigningCannotBeDoneInPlace,
Signing\Authoring\SignPackageRequest.cs (2)
69throw new ArgumentException(Strings.InvalidArgument, nameof(signatureHashAlgorithm)); 75throw new ArgumentException(Strings.InvalidArgument, nameof(timestampHashAlgorithm));
Signing\Authoring\X509SignatureProvider.cs (2)
143exceptionBuilder.AppendLine(Strings.SignFailureCertificateInvalidProviderType); 179exceptionBuilder.AppendLine(Strings.SignFailureCertificateInvalidProviderType);
Signing\Cms\ManagedCmsWrapper.cs (6)
28throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature); 38throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature); 60throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature); 74throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature); 78throw new SignatureException(Strings.Error_NotOneRepositoryCounterSignature); 92throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature);
Signing\Cms\NativeCms.cs (1)
290throw new SignatureException(Strings.Error_NotOneRepositoryCounterSignature);
Signing\Content\KeyPairFileReader.cs (2)
98throw new SignatureException(Strings.InvalidSignatureContent); 103throw new SignatureException(Strings.InvalidSignatureContent);
Signing\Content\SignatureContent.cs (5)
40throw new ArgumentException(Strings.StringCannotBeNullOrEmpty, nameof(hashValue)); 129throw new SignatureException(Strings.UnableToReadPackageHashInformation); 140throw new SignatureException(Strings.InvalidSignatureContent); 174throw new SignatureException(Strings.InvalidSignatureContent); 179throw new SignatureException(NuGetLogCode.NU3007, Strings.UnsupportedSignatureFormatVersion);
Signing\Package\SignedPackageArchive.cs (3)
47throw new SignatureException(Strings.SignedPackageUnableToAccessSignature); 52throw new SignatureException(NuGetLogCode.NU3001, Strings.SignedPackageAlreadySigned); 75throw new SignatureException(Strings.SignedPackageNotSignedOnRemove);
Signing\Signatures\AlgorithmIdentifier.cs (1)
47throw new SignatureException(Strings.SigningCertificateV2Invalid);
Signing\Signatures\AuthorPrimarySignature.cs (2)
21public override string FriendlyName => Strings.AuthorPrimarySignatureFriendlyName; 33string.Format(CultureInfo.CurrentCulture, Strings.SignatureType, Type.ToString())));
Signing\Signatures\CommitmentTypeIndication.cs (1)
71throw new SignatureException(Strings.CommitmentTypeIndicationAttributeInvalid);
Signing\Signatures\CommitmentTypeQualifier.cs (1)
49throw new SignatureException(Strings.InvalidAsn1);
Signing\Signatures\EssCertId.cs (1)
54throw new SignatureException(Strings.SigningCertificateInvalid);
Signing\Signatures\EssCertIdV2.cs (1)
88throw new SignatureException(Strings.SigningCertificateV2Invalid);
Signing\Signatures\GeneralName.cs (2)
90throw new SignatureException(Strings.InvalidAsn1); 103throw new SignatureException(Strings.UnsupportedAsn1);
Signing\Signatures\IssuerSerial.cs (1)
95throw new SignatureException(Strings.InvalidAsn1);
Signing\Signatures\NuGetPackageOwners.cs (4)
25throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(packageOwners)); 30throw new ArgumentException(Strings.NuGetPackageOwnersInvalidValue, nameof(packageOwners)); 54throw new SignatureException(Strings.NuGetPackageOwnersInvalid); 62throw new SignatureException(Strings.NuGetPackageOwnersInvalid);
Signing\Signatures\NuGetV3ServiceIndexUrl.cs (5)
27throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 32throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 51throw new SignatureException(Strings.NuGetV3ServiceIndexUrlInvalid); 58throw new SignatureException(Strings.NuGetV3ServiceIndexUrlInvalid); 63throw new SignatureException(Strings.NuGetV3ServiceIndexUrlInvalid);
Signing\Signatures\PolicyInformation.cs (2)
70throw new SignatureException(Strings.InvalidAsn1); 79throw new SignatureException(Strings.InvalidAsn1);
Signing\Signatures\PolicyQualifierInfo.cs (1)
55throw new SignatureException(Strings.InvalidAsn1);
Signing\Signatures\PrimarySignature.cs (5)
24public override string FriendlyName => Strings.PrimarySignatureFriendlyName; 59throw new SignatureException(NuGetLogCode.NU3009, Strings.Error_NotOnePrimarySignature); 125throw new SignatureException(NuGetLogCode.NU3011, Strings.InvalidPrimarySignature); 137Strings.PrimarySignatureFriendlyName)) 167throw new CryptographicException(Strings.UnexpectedPackageSignatureVerificationError, ex);
Signing\Signatures\RepositoryCountersignature.cs (7)
21public override string FriendlyName => Strings.RepositoryCountersignatureFriendlyName; 54throw new SignatureException(NuGetLogCode.NU3032, Strings.Error_NotOneRepositoryCounterSignature); 59throw new SignatureException(NuGetLogCode.NU3033, Strings.Error_RepositorySignatureMustNotHaveARepositoryCountersignature); 86throw new SignatureException(NuGetLogCode.NU3031, Strings.InvalidRepositoryCountersignature); 99string.Format(CultureInfo.CurrentCulture, Strings.SignatureType, Type.ToString()))); 100issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.NuGetV3ServiceIndexUrl, V3ServiceIndexUrl.ToString()))); 104issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.NuGetPackageOwners, string.Join(", ", PackageOwners))));
Signing\Signatures\RepositoryPrimarySignature.cs (4)
19public override string FriendlyName => Strings.RepositoryPrimarySignatureFriendlyName; 38string.Format(CultureInfo.CurrentCulture, Strings.SignatureType, Type.ToString()))); 39issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.NuGetV3ServiceIndexUrl, V3ServiceIndexUrl.ToString()))); 43issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.NuGetPackageOwners, string.Join(", ", PackageOwners))));
Signing\Signatures\Signature.cs (19)
57public virtual string FriendlyName => Strings.SignatureFriendlyName; 93issues.Add(SignatureLog.Issue(!settings.AllowNoTimestamp, NuGetLogCode.NU3027, Strings.ErrorNoTimestamp)); 103issues.Add(SignatureLog.Error(NuGetLogCode.NU3000, Strings.ErrorMultipleTimestamps)); 150issues.Add(SignatureLog.Issue(!settings.AllowIllegal, NuGetLogCode.NU3010, string.Format(CultureInfo.CurrentCulture, Strings.Verify_ErrorNoCertificate, FriendlyName))); 157Strings.VerificationCertDisplay, 170issues.Add(SignatureLog.Issue(!settings.AllowIllegal, NuGetLogCode.NU3012, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_SignatureVerificationFailed, FriendlyName))); 227issues.Add(SignatureLog.Issue(!settings.AllowIllegal, NuGetLogCode.NU3012, string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue, FriendlyName, message))); 239issues.Add(SignatureLog.Error(NuGetLogCode.NU3012, string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue, FriendlyName, messages.First()))); 251issues.Add(SignatureLog.Issue(!settings.AllowUntrusted, NuGetLogCode.NU3018, string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue_UntrustedRoot, FriendlyName))); 271unknownRevocationMessage = string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue, FriendlyName, unknownRevocationStatusMessages!.First()); 278issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue, FriendlyName, Strings.VerifyCertTrustOfflineWhileRevocationModeOffline))); 290issues.Add(SignatureLog.Issue(!settings.AllowUnknownRevocation, NuGetLogCode.NU3018, string.Format(CultureInfo.CurrentCulture, Strings.VerifyChainBuildingIssue, FriendlyName, Strings.VerifyCertTrustOfflineWhileRevocationModeOnline))); 313Strings.VerifyError_InvalidCertificateChain, 329string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_SignatureNotTimeValid, FriendlyName))); 353Strings.UnrecognizedEnumValue, 361throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.Verify_ErrorNoCertificate, FriendlyName)); 414throw new SignatureException(NuGetLogCode.NU3029, Strings.InvalidTimestampSignature);
Signing\Signatures\SigningCertificate.cs (1)
51throw new SignatureException(Strings.InvalidAsn1);
Signing\Signatures\SigningCertificateV2.cs (1)
66throw new SignatureException(Strings.InvalidAsn1);
Signing\Timestamp\Accuracy.cs (4)
56throw new CryptographicException(Strings.InvalidAsn1); 66throw new CryptographicException(Strings.InvalidAsn1); 76throw new CryptographicException(Strings.InvalidAsn1); 82throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\Extension.cs (1)
53throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\Extensions.cs (1)
46throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\MessageImprint.cs (2)
45throw new CryptographicException(Strings.InvalidAsn1); 50throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\Rfc3161TimestampProvider.cs (10)
35Strings.TimestampFailureInvalidHttpScheme, 149throw new TimestampException(NuGetLogCode.NU3021, Strings.SignError_TimestampSignatureValidationFailed, e); 154throw new TimestampException(NuGetLogCode.NU3020, Strings.SignError_TimestampNoCertificate); 164Strings.TimestampCertificateUnsupportedSignatureAlgorithm, 173throw new TimestampException(NuGetLogCode.NU3023, Strings.SignError_TimestampCertificateFailsPublicKeyLengthRequirement); 183Strings.TimestampSignatureUnsupportedDigestAlgorithm, 192throw new TimestampException(NuGetLogCode.NU3025, Strings.SignError_TimestampNotYetValid); 197throw new TimestampException(NuGetLogCode.NU3036, Strings.SignError_TimestampGeneralizedTimeInvalid); 206throw new TimestampException(NuGetLogCode.NU3026, Strings.TimestampFailureNonceMismatch); 211throw new TimestampException(NuGetLogCode.NU3019, Strings.SignError_TimestampIntegrityCheckFailed);
Signing\Timestamp\Rfc3161TimestampRequestNetstandard21Wrapper.cs (3)
47Strings.AnAbsoluteUriIsRequired, nameof(timestampUri)); 53Strings.HttpOrHttpsIsRequired, nameof(timestampUri)); 66Strings.TimestampServiceRespondedError,
Signing\Timestamp\Rfc3161TimestampTokenInfoNetstandard21Wrapper.cs (1)
22throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\Rfc3161TimestampTokenNetstandard21Wrapper.cs (1)
28throw new CryptographicException(Strings.InvalidAsn1);
Signing\Timestamp\Rfc3161TimestampVerificationUtility.cs (1)
65throw new InvalidDataException(Strings.VerifyError_TimestampInvalid);
Signing\Timestamp\Timestamp.cs (14)
72throw new TimestampException(NuGetLogCode.NU3021, Strings.VerifyError_TimestampSignatureValidationFailed, ex); 84throw new TimestampException(NuGetLogCode.NU3021, Strings.VerifyError_TimestampSignatureValidationFailed); 120issues.Add(SignatureLog.Issue(treatIssueAsError, NuGetLogCode.NU3020, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampNoCertificate, signature.FriendlyName))); 131issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.TimestampValue, GeneralizedTime.LocalDateTime.ToString(CultureInfo.CurrentCulture)) + Environment.NewLine)); 134Strings.VerificationTimestamperCertDisplay, 185issues.Add(SignatureLog.Issue(treatIssueAsError, NuGetLogCode.NU3028, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampVerifyChainBuildingIssue, signature.FriendlyName, message))); 200issues.Add(SignatureLog.Error(NuGetLogCode.NU3028, string.Format(CultureInfo.CurrentCulture, Strings.VerifyTimestampChainBuildingIssue_UntrustedRoot, signature.FriendlyName))); 208issues.Add(SignatureLog.Error(NuGetLogCode.NU3028, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampVerifyChainBuildingIssue, signature.FriendlyName, messages!.First()))); 224unknownRevocationMessage = string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampVerifyChainBuildingIssue, signature.FriendlyName, unknownRevocationStatusMessages!.First()); 231issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampVerifyChainBuildingIssue, signature.FriendlyName, Strings.VerifyCertTrustOfflineWhileRevocationModeOffline))); 243issues.Add(SignatureLog.Issue(!settings.AllowUnknownRevocation, NuGetLogCode.NU3028, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampVerifyChainBuildingIssue, signature.FriendlyName, Strings.VerifyCertTrustOfflineWhileRevocationModeOnline))); 270Strings.VerifyError_InvalidCertificateChain,
Signing\Timestamp\TstInfo.cs (3)
89throw new CryptographicException(Strings.InvalidAsn1); 141throw new CryptographicException(Strings.InvalidAsn1); 147throw new CryptographicException(Strings.InvalidAsn1);
Signing\TrustedSigners\TrustedSignersProvider.cs (2)
37throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(trustedSigners)); 105string.Format(CultureInfo.CurrentCulture, Strings.ConflictingAllowUntrustedRoot, certificate.HashAlgorithm.ToString(), certificate.Fingerprint),
Signing\TrustStore\CertificateBundleX509ChainFactory.cs (2)
95Strings.UntrustedRoot_WithoutCertificateBundle, 104Strings.UntrustedRoot_WithCertificateBundle,
Signing\TrustStore\FallbackCertificateBundleX509ChainFactory.cs (1)
41_ => throw new ArgumentException(Strings.InvalidX509StorePurpose, nameof(storePurpose))
Signing\TrustStore\X509TrustStore.cs (8)
90throw new ArgumentException(Strings.InvalidX509StorePurpose, nameof(storePurpose)); 115Strings.ChainBuilding_UsingSystemCertificateBundle, 129Strings.ChainBuilding_UsingFallbackCertificateBundle, 135logger.LogInformation(Strings.ChainBuilding_UsingNoCertificateBundle); 150Strings.ChainBuilding_UsingFallbackCertificateBundle, 156logger.LogInformation(Strings.ChainBuilding_UsingNoCertificateBundle); 171logger.LogInformation(Strings.ChainBuilding_UsingDefaultTrustStoreForCodeSigning); 175logger.LogInformation(Strings.ChainBuilding_UsingDefaultTrustStoreForTimestamping);
Signing\Utility\AttributeUtility.cs (11)
64throw new SignatureException(Strings.CommitmentTypeIndicationAttributeInvalidCombination); 87throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 92throw new ArgumentException(Strings.InvalidUrl, nameof(v3ServiceIndexUrl)); 128Strings.ExactlyOneAttributeRequired, 137Strings.ExactlyOneAttributeValueRequired, 157throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(packageOwners)); 162throw new ArgumentException(Strings.NuGetPackageOwnersInvalidValue, nameof(packageOwners)); 200Strings.ExactlyOneAttributeValueRequired, 326throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(oid)); 339throw new CryptographicException(string.Format(CultureInfo.CurrentCulture, Strings.MultipleAttributesDisallowed, oid)); 362throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(oid));
Signing\Utility\CertificateChainUtility.cs (3)
82throw new ArgumentException(Strings.InvalidArgument, nameof(certificateType)); 130throw new TimestampException(logCode, Strings.CertificateChainValidationFailed); 133throw new SignatureException(logCode, Strings.CertificateChainValidationFailed);
Signing\Utility\CertificateUtility.cs (18)
51issues.Add(SignatureLog.MinimalLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateSubjectName, cert.Subject)}")); 52issues.Add(SignatureLog.InformationLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateHashSha1, cert.Thumbprint)}")); 53issues.Add(SignatureLog.MinimalLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateHash, fingerprintAlgorithm.ToString(), certificateFingerprint)}")); 54issues.Add(SignatureLog.InformationLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateIssuer, cert.IssuerName.Name)}")); 55issues.Add(SignatureLog.MinimalLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateValidity, cert.NotBefore, cert.NotAfter)}")); 59issues.Add(SignatureLog.InformationLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateCrlUrl, url)}")); 64issues.Add(SignatureLog.InformationLog($"{indentation}{string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateOcspUrl, url)}")); 74certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateSubjectName, cert.Subject)); 75certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateHashSha1, cert.Thumbprint)); 76certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateHash, fingerprintAlgorithm.ToString(), certificateFingerprint)); 77certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateIssuer, cert.IssuerName.Name)); 78certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateValidity, cert.NotBefore, cert.NotAfter)); 82certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateCrlUrl, url)); 87certStringBuilder.AppendLine(indentation + string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityCertificateOcspUrl, url)); 112collectionStringBuilder.AppendLine(Strings.CertUtilityMultipleCertificatesHeader); 123collectionStringBuilder.AppendLine(string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityMultipleCertificatesFooter, certCollection.Count - ChainDepthLimit)); 145collectionStringBuilder.AppendLine(string.Format(CultureInfo.CurrentCulture, Strings.CertUtilityMultipleCertificatesFooter, chainElementsCount - ChainDepthLimit)); 349throw new SignatureException(Strings.CertificateChainValidationFailed);
Signing\Utility\SignatureUtility.cs (25)
80throw new ArgumentException(Strings.UnrelatedSignatures, nameof(repositoryCountersignature)); 118noCertificateString: string.Format(CultureInfo.CurrentCulture, Strings.Verify_ErrorNoCertificate, signatureFriendlyName), 120invalidSignatureString: Strings.InvalidPrimarySignature, 174throw new SignatureException(NuGetLogCode.NU3000, Strings.PrimarySignatureHasNoTimestamp); 213throw new ArgumentException(Strings.UnrelatedSignatures, nameof(repositoryCountersignature)); 220throw new SignatureException(NuGetLogCode.NU3000, Strings.RepositoryCountersignatureHasNoTimestamp); 248noCertificateString: Strings.RepositoryCountersignatureHasNoCertificate, 250invalidSignatureString: Strings.InvalidRepositoryCountersignature, 337noCertificateString: string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampNoCertificate, signatureFriendlyName), 339invalidSignatureString: string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampInvalid, signatureFriendlyName), 441Strings.MultipleAttributesDisallowed, 451Strings.ExactlyOneAttributeValueRequired, 465Strings.MultipleAttributesDisallowed, 475Strings.ExactlyOneAttributeValueRequired, 490throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateAttributeMustNotBePresent); 498Strings.ExactlyOneAttributeRequired, 507throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateV1OrV2AttributeMustBePresent); 519throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateV2Invalid); 528throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateV2UnsupportedHashAlgorithm); 534throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateV2CertificateNotFound); 545throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateInvalid); 550throw new SignatureException(errors.InvalidSignature, Strings.SigningCertificateCertificateNotFound); 563throw new SignatureException(errors.ChainBuildingFailed, Strings.CertificateChainBuildFailed); 668throw new SignatureException(Strings.CertificateChainValidationFailed); 687throw new SignatureException(string.Format(CultureInfo.CurrentCulture, Strings.SignatureContainsInvalidAttribute, attribute.Oid.Value));
Signing\Utility\SigningUtility.cs (11)
35throw new SignatureException(NuGetLogCode.NU3013, Strings.SigningError_CertificateHasUnsupportedSignatureAlgorithm); 40throw new SignatureException(NuGetLogCode.NU3014, Strings.SigningError_CertificateFailsPublicKeyLengthRequirement); 45throw new SignatureException(NuGetLogCode.NU3015, Strings.SigningError_CertificateHasLifetimeSigningEKU); 50throw new SignatureException(NuGetLogCode.NU3017, Strings.SigningError_NotYetValid); 67throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(chainList)); 97throw new ArgumentException(Strings.ArgumentCannotBeNullOrEmpty, nameof(chainList)); 194throw new SignatureException(NuGetLogCode.NU3006, Strings.ErrorZip64NotSupported); 202throw new SignatureException(NuGetLogCode.NU3039, Strings.SigningWouldRequireZip64); 212throw new SignatureException(NuGetLogCode.NU3033, Strings.Error_RepositorySignatureMustNotHaveARepositoryCountersignature); 217throw new SignatureException(NuGetLogCode.NU3032, Strings.SignedPackagePackageAlreadyCountersigned); 225throw new SignatureException(NuGetLogCode.NU3001, Strings.SignedPackageAlreadySigned);
Signing\Utility\VerificationUtility.cs (13)
73issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3013, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_CertificateHasUnsupportedSignatureAlgorithm, signatureFriendlyName))); 79issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3014, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_CertificateFailsPublicKeyLengthRequirement, signatureFriendlyName))); 85issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3015, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_CertificateHasLifetimeSigningEKU, signatureFriendlyName))); 91issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3017, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_CertificateNotYetValid, signatureFriendlyName))); 127issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3021, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampSignatureValidationFailed, signature.FriendlyName))); 134issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3022, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampUnsupportedSignatureAlgorithm, signature.FriendlyName))); 140issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3023, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampCertificateFailsPublicKeyLengthRequirement, signature.FriendlyName))); 146issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3024, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampSignatureUnsupportedDigestAlgorithm, signature.FriendlyName))); 158issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3019, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampIntegrityCheckFailed, signature.FriendlyName))); 165issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3030, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampMessageImprintUnsupportedHashAlgorithm, signature.FriendlyName))); 171issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3025, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampNotYetValid, signature.FriendlyName))); 177issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3036, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampGeneralizedTimeInvalid, signature.FriendlyName))); 183issues.Add(SignatureLog.Issue(treatIssuesAsErrors, NuGetLogCode.NU3020, string.Format(CultureInfo.CurrentCulture, Strings.VerifyError_TimestampNoCertificate, signature.FriendlyName)));
Signing\Verification\AllowListVerificationProvider.cs (2)
26_emptyListErrorMessage = string.IsNullOrEmpty(emptyListErrorMessage) ? Strings.DefaultError_EmptyAllowList : emptyListErrorMessage; 27_noMatchErrorMessage = string.IsNullOrEmpty(noMatchErrorMessage) ? Strings.DefaultError_NoMatchInAllowList : noMatchErrorMessage;
Signing\Verification\CertificateHashAllowListEntry.cs (3)
25Strings.UnrecognizedEnumValue, 35Strings.UnrecognizedEnumValue, 46Strings.InvalidArgumentCombination,
Signing\Verification\IntegrityVerificationProvider.cs (4)
30issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.SignatureHashAlgorithm, signature.SignatureContent.HashAlgorithm))); 40issues.Add(SignatureLog.Error(NuGetLogCode.NU3008, Strings.SignaturePackageIntegrityFailure)); 46issues.Add(SignatureLog.Issue(!settings.AllowIllegal, NuGetLogCode.NU3016, Strings.SignatureFailureInvalidHashAlgorithmOid)); 47issues.Add(SignatureLog.DebugLog(string.Format(CultureInfo.CurrentCulture, Strings.SignatureDebug_HashOidFound, signatureHashOid)));
Signing\Verification\PackageSignatureVerifier.cs (2)
76SignatureLog.Issue(!settings.AllowIllegal, NuGetLogCode.NU3003, Strings.ErrorPackageSignatureInvalid), 92var issues = new[] { SignatureLog.Issue(fatal: true, code: NuGetLogCode.NU3004, message: Strings.ErrorPackageNotSigned) };
Signing\Verification\SignatureTrustAndValidityVerificationProvider.cs (1)
130issues = issues.Concat(new[] { SignatureLog.Error(NuGetLogCode.NU3038, Strings.NoRepositoryCountersignature) });
Signing\Verification\SignedPackageVerifierSettings.cs (5)
95Strings.UnrecognizedEnumValue, 105Strings.UnrecognizedEnumValue, 115Strings.UnrecognizedEnumValue, 126Strings.InvalidArgumentCombination, 140Strings.InvalidArgumentCombination,
Signing\Verification\VerificationAllowListEntry.cs (1)
24throw new ArgumentException(Strings.ErrorAuthorTargetCannotBeACountersignature);
StringFormatter.cs (3)
19Strings.Log_InstalledPackage, 33Strings.ZipFileLastWriteTimeStampModifiedMessage, 42return Strings.ZipFileTimeStampModifiedWarning + Environment.NewLine + listOfFileTimeStampModifiedMessages;
Strings.Designer.cs (1)
42global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NuGet.Packaging.Strings", typeof(Strings).Assembly);