Could someone please tell me a way to just store the username from a DoD CAC card? I do not need to do any authentication, just have the name from a card stored as a variable. I don't think the machine reading the cards will have any network connection. I'm language/OS agnostic at this point.
Thank you.
So I will answer for Windows and Java.
Enumerate the terminals, then if a card is present, (assuming only current CAC cards):
cc.transmit(new CommandAPDU(CMD_SELECT_APPLET_CAC_CACV2_PKI_IDENTITY_KEY));
cc.transmit(new CommandAPDU(CMD_SELECT_EF_CACV2_PKI_IDENTITY_KEY));
List<byte[]>[] res = TLVContainer.getTagAndValues(cc);
x509cert = X509CACHelper.fromBytes(res[0x71].get(0)[0],res[0x70].get(0));
You can look up the select applet and select EF commands in nist 6887, the RID, AID, OID can be found on docs at cac.mil.
Related
I am trying to request real time data using TWS via Matlab's IB API. I don't want regular market data though, specifically I am trying to obtain implied volatility. This is the guide I am using: http://www.mathworks.com/help/trading/ibtws.realtime.html
I should be able to obtain IV just by plaching f='106' according to IB API: https://www.interactivebrokers.com/en/software/api/api.htm
But everytime I get the same thing (RTVolume), that is, bid, ask, last etc. I am always getting market data regardless of what the integer ID flag is changed to.
This is my code:
try
close(ib);
close(conn);
catch
end
clear all;
ibBuiltInRealtimeData = struct('id',0,'BID_PRICE',0,'BID_SIZE',0,'ASK_PRICE',0,'ASK_SIZE',0);
while true
ib = ibtws('',7496);
f = '106';
ibContract = ib.Handle.createContract;
ibContract.symbol = 'AAPL';
ibContract.secType = 'STK';
ibContract.exchange = 'SMART';
ibContract.primaryExchange = '';
ibContract.currency = 'USD';
tickerid = realtime(ib,ibContract,f);
d2 = ibBuiltInRealtimeData;
d2
pause(1);
end
And this is the output:
id: 5689.00
BID_PRICE: 102.55
BID_SIZE: 1.00
ASK_PRICE: 103.00
ASK_SIZE: 1.00
LAST_PRICE: 102.79
LAST_SIZE: 0
VOLUME: 434689.00
I see no implied volatility anywhere! How can I request real time data of other things besides market data?
It's an easy explanation but not the one you want to hear:
The contract you're using is a stock and not an option. Like you can read in the API Manual:
Note: not all tick types are available for all instruments at all times. If you are not receiving a specific tick type when you think you should see if the tick type in question is available within the TWS itself. Remember the TWS API is only a delivery channel: if the information is not available in the TWS itself first, the TWS will not be able to dispatch it via the API socket.
The tick type "Option Implied Volatility" (Tick Id 24) is used for options and therefore it's not available for stocks.
Just use another contract and you'll get your expected result.
I hope this helps.
How do you know the current size of an SQLDB? Normally with DB2 I would check how much diskspace there is left to understand if the database is starting to get full. But as I don't have access to the file system I would like to know what the recommended alternative method is.
Best Regards
W
There is a built-in routine that might be able to help you:
CALL GET_DBSIZE_INFO(?, ?, ?, -1)
You can see more information about the routine on the IBM Knowledge Center. The routine above would return something like this, for example:
Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2004-02-29-18.31.55.178000
Parameter Name : DATABASESIZE
Parameter Value : 22302720
Parameter Name : DATABASECAPACITY
Parameter Value : 4684793856
Return Status = 0
You can find the SQLDB usage details by clicking the Profile Settings icon in the upper-right corner of the Bluemix user interface and selecting Account -> Usage Details. If you expand Service Charges, you should see your db instance listed with a $$ figure denoted. On the right, you can expand the twistie and you should be able to see your current usage in GBs.
I am developing embedded firmware to communicate with the Multi-Tech's MTSMC-H5 GPRS Modem. I am unclear the use of AT+CGDCONT command. In the H5 modem's Reference Guide, it states the command format is
>AT+CGDCONT=[<cid>[,<PDP_type>[,<APN>[,<PDP_addr>[,<d_comp>
>[,<h_comp>[,<pd1>[,…[,pdN]]]]]]]]]
>...
><APN> Access Point Name. String parameter that is a logical name used to select the
>GGSN or the external packet data network. If the value is empty (“”) or omitted,
>3GPP TS 27.007 AT COMMANDS then the subscription value is requested.
>...
What effect would that be if I leave the APN field blank? It seems I can connect to the cell network while leaving the APN field blank. I tried several SIM cards and they all seem to work without specifying the APN field. However, I'd like to know for sure that what I do is appropriate. Because I have very limited UI capability (no real keypad on the device that the modem is attached to), it is highly desirable if an end user does not have to enter any APN information.
The APN was probably stored on the SIMs that you used. In most cases, it will be OK as you found out. There are a few edge cases where you might run into problems, such as an APN changing (rare), or arrangements between individual operators, or between operators and certain customers.
Even these cases can be mitigated by some operators as they automatically correct a wrong APN (APN redirection).
Note that this is not behaviour that is mandatory under the 3GPP standards, so it may vary from operator to operator.
For our website, we set up the account activation email with the following tutorial (in cakephp):
http://www.jonnyreeves.co.uk/2008/06/cakephp-activating-user-account-via-email/
On our live site, it seems that the activation works for the most part, however some people are receiving the following error when clicking on the activation email link to activate their account:
Error: The requested address '/users/activate/36/10a1a794' was not found on this server.
This is odd to me because the link looks fine: "users" controller, "activate" action, user_id = 36, and hash code = 0a1a794. Not sure why this error is happening. One thing I read is to clear the files in the cache folder and that didn't seem to change anything. Please help thanks!
The activation hash has limited validity(same day).
So if send the activation email on 1st of any month, it will be valid till 11:59pm of 1st. The link wont work after 12:00am(technically 2nd of the month).
Hope that helps.
Yes, that's what Josh R said, the hash is computed for the same day and this is a VERY bad idea.
You should either stop hashing the date or validate against two values: one for today's date, one for yesterday's date.
Also, a recommendation: don't just go there and copy the files, try to learn something from it and please, do it your way. You'll learn a lot more.
Is there any way to find out the latitude/longitude of a place using IP address.
ip2location.com has a number of resources (some of which are free) for doing this, including scripts and demo databases - but I'm no iphone expert so I don't know if they're of any use in that particular environment.
I use quite a good free api for that in my PHP projects: http://api.hostip.info/?ip=IPADDRESSTOLOOKUP
returls XML... not sure if this is of use to you! :)
But the iphone is supposed to have an embedded gps chip, so I think you might use it to get this information.
Moreover, I think that with IPV6 you'll be able to use a given IP from multiple locations.
Assuming you're trying to find the position of someone/thing else, then generally no. There are a few exceptions, for when that IP address is registered to an individual business, which in turn list their full address in the whois record. You could then geocode that using a webservice (etc.) to get lat/long.
If you're trying to find out where you are, then you're probably better off using the built in GPS
The IP address doesn't uniquely identify a location.
I know I get a lot of unwanted ads telling me about good times to be had in my location.
The problem is the location is wrong.
I would say that this is a very easy way to do get the latitude and longitude. You can even get it of the user who is visiting your site.
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
//$user_location is returning latitude , longitude
$user_location = $details->loc;
//you can split them like this som you get them in two different variables
$pieces = explode(",", $user_location);
$lat = $pieces[0];
$lon = $pieces[1];