Skip to content

Commit

Permalink
dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
scribetw committed Sep 22, 2023
1 parent 8b70bd2 commit 3053731
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/src/c14n_canonicalization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ class C14nCanonicalization implements CanonicalizationAlgorithm<String> {

//render namespaces
for (final ns in nsListToRender) {
res.add(' xmlns${ns.prefix.isNotEmpty ? ':${ns.prefix}' : ''}="${ns.namespaceURI}"');
res.add(
' xmlns${ns.prefix.isNotEmpty ? ':${ns.prefix}' : ''}="${ns.namespaceURI}"');
}

return RenderNsResult(res.join(''), newDefaultNs);
Expand Down
12 changes: 6 additions & 6 deletions lib/src/signed_xml.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ List<XmlNamespace> _collectAncestorNamespaces(XmlNode node,
for (var attr in parent.attributes) {
final name = attr.name.qualified;
if (name.startsWith(regexp)) {
nsArray.add(
XmlNamespace(name.replaceFirst(regexp, ''), attr.value));
nsArray.add(XmlNamespace(name.replaceFirst(regexp, ''), attr.value));
}
}

Expand Down Expand Up @@ -699,8 +698,7 @@ class SignedXml {
if (currentPrefix.isNotEmpty) currentPrefix += ':';

if (keyInfoProvider != null) {
final keyInfoAttrs = StringBuffer(),
attrs = keyInfoProvider!.attrs;
final keyInfoAttrs = StringBuffer(), attrs = keyInfoProvider!.attrs;
if (attrs != null) {
for (var entry in attrs.entries) {
keyInfoAttrs.write(' ${entry.key}="${entry.value}"');
Expand Down Expand Up @@ -903,12 +901,14 @@ class FileKeyInfo implements KeyInfoProvider {
@override
String getKeyInfo(Uint8List? signingKey, String? prefix) {
var currentPrefix = prefix ?? '';
currentPrefix = currentPrefix.isNotEmpty ? '$currentPrefix:' : currentPrefix;
currentPrefix =
currentPrefix.isNotEmpty ? '$currentPrefix:' : currentPrefix;
final signingCert = StringBuffer();
if (signingKey != null) {
final certArray = [signingKey];
for (var cert in certArray) {
signingCert.write("<${currentPrefix}X509Certificate>${base64Encode(cert)}</${currentPrefix}X509Certificate>");
signingCert.write(
"<${currentPrefix}X509Certificate>${base64Encode(cert)}</${currentPrefix}X509Certificate>");
}
}
return '<${currentPrefix}X509Data>${signingCert.toString()}</${currentPrefix}X509Data>';
Expand Down

0 comments on commit 3053731

Please sign in to comment.