I am trying to build an application to deal with smart card on mac but when I try to use the defaultManager of TKSmartCardSlotManager to read the smart card it returns as nil because the com.apple.secuirty.smartcard entitlement is not set to true that what I read in the mac TKSmartCard.h file in the comments but I am so new in dealing with mac and don't know how to set it to true through the calling application.
Any help would be greatly appreciated.
Edit:
what I tried so far is creating a property list file and adding it to the project then building it with the project but still it seems it doesn't add the required entitlement. this is the file I add :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.smartcard</key>
<true/>
</dict>
</plist>
The answer was simply writing a .entitlements file contains the following :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.smartcard</key>
<true/>
</dict>
</plist>
Then add my project.entitlements to code signing entitlements in Xcode build settings.
Related
I am creating a watchOS app using SwiftUI and I wish to add a splash screen, but I am not sure whether it's possible. I have added the following to the Info.plist file, but doesn't seem to show a splash screen.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchScreen</key>
<dict>
<key>UIImageName</key>
<string>Rupee</string>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Sample</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>google.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>Sample</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>Sample</string>
</dict>
<key>WKWatchOnly</key>
<true/>
</dict>
</plist>
Unfortunately (as of September 2021), WatchOS does not support a Launch Screen yet. I don't know if you noticed yet, but when an app launches on the watch, the app icon shows up with a progress view around it which is the default WatchOS launch screen for the apps and cannot be changed.
For more info: Could we set Launch screen in apple watch?
For a fake launch screen, you can do something like this:
#State var shouldShowLaunchImage = true
var body: some View {
ContentView()
.overlay(
Image("launch-image")
.opacity(shouldShowLaunchImage ? 1 : 0)
)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
self.shouldShowLaunchImage = false
}
}
}
I have written a syntax highlighter for Fortran, which properly highlights comments. The problem is that the ctrl+/ shortcut does not toggle comments on or off.
Is there something settings specific I need to add to enable this?
For reference, I used the standard *.sublime-syntax file structure that Sublime provides to build the highlighter. So, it looks something like:
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions: [f]
scope: source.fortran
contexts:
main:
# Comments begin with a '!' and finish at the end of the line
- match: '!'
scope: punctuation.definition.comment.fortran
push: line_comment
line_comment:
- meta_scope: comment.line.fortran
- match: $
pop: true
Also, I'm using it on RedHat 7.
You need to create a file called Comments.tmPreferences in the same folder as your Fortran.sublime-syntax file, with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.fortran</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>! </string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>65507EAD-D547-44E4-84F7-7D421DD078B0</string>
</dict>
</plist>
I don't think the UUID is needed in Sublime (these files were originally developed for use in the Mac editor TextMate), so feel free to get rid of it if you want. Other than that, this should do what you want it to do - insert ! at the beginning of any selected line when you hit Ctrl/.
I have a vapp instantiated on vcd host via my template, vapp network config section xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd">
<ovf:Info>The configuration parameters for logical networks</ovf:Info>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/"/>
<NetworkConfig networkName="VM Network">
<Link rel="repair" href="https://mycloud.stratogen.com/api/admin/network/86d21d4f-0b15-44e3-877e-5b5160ea9271/action/reset"/>
<Description>The VM Network network</Description>
<Configuration>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>192.168.254.1</Gateway>
<Netmask>255.255.255.0</Netmask>
<IpRanges>
<IpRange>
<StartAddress>192.168.254.100</StartAddress>
<EndAddress>192.168.254.199</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
<FenceMode>isolated</FenceMode>
<RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
</Configuration>
<IsDeployed>false</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
So, I have read official vmware documentation about NetworkConfigSection and tried to add ParentNetwork and switch to natRouted fence mode exactly as it was in example:
https://pubs.vmware.com/vcd-51/index.jsp?topic=%2Fcom.vmware.vcloud.api.doc_51%2FGUID-92622A15-E588-4FA1-92DA-A22A4757F2A0.html
So, now my XML looks like:
<?xml version="1.0" encoding="UTF-8"?>
<NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd">
<ovf:Info>The configuration parameters for logical networks</ovf:Info>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/"/>
<NetworkConfig networkName="VM Network">
<Link rel="repair" href="https://mycloud.stratogen.com/api/admin/network/86d21d4f-0b15-44e3-877e-5b5160ea9271/action/reset"/>
<Description>The VM Network network</Description>
<Configuration>
<IpScopes>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>192.168.254.1</Gateway>
<Netmask>255.255.255.0</Netmask>
<IpRanges>
<IpRange>
<StartAddress>192.168.254.100</StartAddress>
<EndAddress>192.168.254.199</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
</IpScopes>
<FenceMode>natRouted</FenceMode>
<ParentNetwork
type="application/vnd.vmware.vcloud.network+xml"
name="Internet"
href="https://vcloud.example.com/api/network/54" />
<RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
</Configuration>
<IsDeployed>false</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
After that I submitted PUT request to edit URL and I got an error:
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="BAD_REQUEST" message="Bad request
- Unexpected JAXB Exception
- cvc-complex-type.2.4.a: Invalid content was found starting with element \'ParentNetwork\'. One of \'{"http://www.vmware.com/vcloud/v1.5":RetainNetInfoAcrossDeployments, "http://www.vmware.com/vcloud/v1.5":Features, "http://www.vmware.com/vcloud/v1.5":SyslogServerSettings, "http://www.vmware.com/vcloud/v1.5":RouterInfo}\' is expected." majorErrorCode="400" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd"></Error>
How could I add parent network to existing vApp using vCloudDirector rest api?
Thanks.
I'm following step-by-step (basically copying and pasting stuff) this spring-ws tutorial and I just hit a wall when configuring the spring-ws-servlet.xml as below:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services
http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
<context:component-scan base-package="com.mycompany.hr"/>
<sws:annotation-driven/>
</beans>
Adding the following line:
<context:component-scan base-package="com.mycompany.hr"/>
make STS starts yelling at me that:
cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declarationcan be found for element 'context:component-scan'.
I don't know how to proceed..
You need to add:
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
to the schemaLocation.
I am attempting to get xincludes working in an existing system that uses a XercesDOMParser in xercesc to parse incoming xml from a client. I am working with Apache Xercesc v3.0.1, and the incoming XML, read from an input stream, is:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="testguioutput.xml" />
while testguioutput.xml contains
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
The existing code uses a wrapper around a XercesDOMParser to parse the XML as it comes in, and after using setDoNamespaces and setDoXInclude to true, it is attempting to parse the XInclude, but I get a persistent "Fatal: include failed and no fallback element found in document '{0}'" error, no matter where in the directory structure I put testguioutput.xml.
I am working under visualstudio 2008, my working directory is default, and running out of /project/debug, but the include fails whether the target file is in /project/ or /project/debug/.
I was able to expand the xinclude tags using the XInclude.exe sample application that is included with the Xerces application. To do this, I created two files using your files above:
test1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="test2.xml"/>
</CompositeObject>
</VisionServer>
test2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
At the command line I executed:
"XInclude.exe test1.xml test1_expanded.xml" without quotes.
The resulting test1_expanded.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<VisionServer xmlns="" xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<GUIOutput xml:base="test2.xml">
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
</CompositeObject>
</VisionServer>