4G Wireless Network Technology
The name 4G is for further advance invention in wireless networks likely mobile phones to the up coming generation. One contributor in several parts of United States of America only offered it in 2009. Un till now no company contracted to represent 4G mobiles technology, currently it is just only a market term.
The alphabet “G” in term 4G means generation, in wireless networks like cellular phones using “G” technology from last 20 to 30 years. The technology o 1G occupied the first commonly existing cellular phones, the launched of 2G technology in begin of year 1990 brought a digital format of text messaging. After introduced of 3G technology which also brought a great option to carry data or improved info-services of how to carry websites in the original form. Now day’s iPhone is the latest and well-recognized exemplar of 3G mobile technology.
Un till now 4G mobiles is not set up as a contract. Therefore the appearance of 4G merely a market term and somewhat necessities. There should be safe and secure connection of 4G because if it’s high rate data transfer speed. An additional objective is to provide good network coverage because some time it causes trouble when it is use between several network-covered areas. An IP address based network programs should use in 4G mobile technologies for using Internet services.
The two foremost system Wimax and Clearwire, are using 4G mobile technologies within the boundaries of United States of America, a organization where major part of proprietor is Sprint Nextel. In 2008 at Baltimore it was the start of testing services further they planned to spread it out in markets in 2009. So they set up a plan to provide coverage up to 80 cities till end of 2010.
Generally Verizon backs the competitor methods, durable Evolution or LTE. It was probably anticipated that they make it prepared for testing in 2010 but due to the LTE sponsor prevail over some inconvenience by providing higher speed and manufacturing contemptible equipments, it will launch for common usage in 2012.
The Fourth Generation mobile technologies will be commonly used in cellular phones and also in computers for using Internet services. In areas having good network coverage can also avail the services of connection of home broadband without installing any cables and wires. The 4G wireless connections can be easily carried to everywhere for using Internet services and can it use when you are hanging out with friends, airports, subways, and coffee café.
L E M O N J U I C E
The local bar was so sure that its bartender was the strongest man around that they offered a Rs 10,000 bet.
The bartender would squeeze a lemon until all the juice ran into a glass, and hand the lemon to a patron. Anyone who could squeeze one more drop of juice out would win the money.
Many people like weightlifters, wrestlers, body builders, etc had tried over time, but nobody could do it.
One day this scrawny little man came in, wearing thick glasses and a safari suit, and said in a tiny, squeaky voice, "I'd like to try the bet."
After the laughter had died down, the bartender said OK, grabbed a lemon, and squeezed away. Then he handed the wrinkled remains of the rind to the little man.
But the crowd's laughter turned to total silence as the man clenched his fist around the lemon and 5-6 drops fell into the glass.
As the crowd cheered, the bartender paid the Rs 10,000, and asked the little man, "What do you do for a living? Are you a lumberjack, a weightlifter, or what?"
"No," replied the man.
"I work as a project manager in a software company !"
Rajini kanth’s advice to all Project Managers
“Commitment should be there, not commotion,
pressure should be there, but should not be panicky,
softness should be there, should not shout like this …
On a whole a manager should be a manager, not a damager.
You know one thing; Faulty Design document is the root cause for all Bugs”.
LAST BUT NOT THE LEAST!!….
“Highly tensioned Project Manager or a lengthy coding Programmer can never complete a project successfully”.
Project Managers
Team of Managers was given an assignment to measure the height of a flagpole. So theManagers go out to the flagpole with ladders and tape.They’re falling off the ladders, dropping the tape measures - the whole thing is just a mess.
An Engineer comes along and sees what they’re trying to do, walks over,pulls the flagpole out of the ground, lays it flat, measures it from end to end, gives the measurement to one of the managers and walks away.
After the Engineer has gone, one manager turns to another and laughs.”See this idiot. We’re looking for height and he gives the length!”
Moral: “No matter what good you do, Managers can always find fault in you”
Appraisal letter
Dear Manager (HR),
Vivek, my assistant programmer, can always be found
hard at work in his cubicle. Vivek works independently, without
wasting company time talking to colleagues. Vivek never
thinks twice about assisting fellow employees, and he always
finishes given assignments on time. Often Vivek takes extended
measures to complete his work, sometimes skipping coffee
breaks. Vivek is a dedicated individual who has absolutely no
vanity in spite of his high accomplishments and profound
knowledge in his field. I firmly believe that Vivek can be
classed as a high-caliber employee, the type which cannot be
dispensed with. Consequently, I duly recommend that Vivek be
promoted to executive management, and a proposal will be
sent away as soon as possible.
Signed - Project Leader
NB: That stupid idiot was reading over my shoulder when I wrote the report sent to you earlier today. Kindly read only the odd lines (1, 3, 5, 7, 9,11, 13) for my true assessment of him.
Upcoming Telugu top 50 Block Busters....
Upcoming Telugu Block Busters
1) IT Rajyam!!
2) Job ochina kothalo....!
3) A Company aithe naakenti..!?,
4) Job vachindhi kaani.....!
5) Fire aina Mogudu - Job vachhina pellam
6) Priyudu nerpina PASCAL,
7) Pellam PM aithe!!?,
8) Project dorakani Papa,
9) Company pettalani vundhi..!
10) Iddaru programmerla muddula tester
11) Job-e-naa pranam!,
12) Oracle dada-DBMS!,
13) Toli project...!
14) Yevandi mailochindi,
15) Project kosam,
16) Coding Ramudu
17) Intlo baava - Office lo Java,
18) Aaruguru programmerlu!!!,
19) Pandanti Project!
20) COBOL kaatesindi,
21) Programmer malli puttadu..!,
22) Sri SAP Swamy Mahatyam...!!,
23) Offshore lo puli - Onsite lo pilli
24) ...Nee Password Naaku Telusu !
25) Amma,Nanna,O'software engineer!!
26) Srivaariki Oka E-Mail,
27) Review cheddam raa,
28) Naakuuu...Project kaavaali..!
29) ...Sorry... naaku already job vundi,
30) Testing ante ideraa
31) Vaddu Bava....Java!!
32) Pavitra project!!
33) Basics Nerpina Bava...!!
34) Mogudu,Pellam,.. O'project!!
35) Ammo! Project Delivery!?
36) Premalo....PM,Programmer!
37) PM..! Vastunnadu jaagratha!!
38) Onsite andagaadu - Offshore Sundari,
39) Evadi coding vaadidhi!!
40) Repati Programmerlu..!
41) Vaadu Proggrammer Kaadu....!
42) Adirindayya Tester!!!
43) Programmer,Tester Madhyalo Bug!!
44) Developer....Chandra kanth!!
45) Wipro Mogudu,Infy Pellam!!
46) Avunu! Vaalliddaru Testerlu!!
47) Tester No:1
48) Nuvvu,Nenu...Project!
49) Project Chesi Choodu!!
50) PM Chebithe Vinaali!!!
WeddingQuery -SQL Style
CREATE PROCEDURE MyMarriage
BrideGroom Male (25) ,
Bride Female(20) AS
BEGIN
SELECT Bride FROM india_ Brides
WHERE FatherInLaw = 'Millionaire' AND Count(Car) > 20 AND HouseStatus ='ThreeStoreyed'
AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MiBA) AND Having Brothers= Null AND Sisters =Null
SELECT Gold ,Cash,Car,BankBalance FROM FatherInLaw
UPDATE MyBankAccout SET MyBal = MyBal + FatherInLawBal
UPDATE MyLocker SET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTO MyCarShed VALUES ('BMW')
END
GO
Then the wife writes the below query:
.
.
.
.
.
.
.
.
.
.
DROP HUSBAND;
Commit;
A mind blowing love story
Hero loves heroine...........
but Heroine loves Villain...........
but Villain loves Hero`s Sister..........
but Hero`s Sister loves Heroine`s Brother..........
but Heroine`s Brother loves Villain`s Sister..........
but Villain`s Sister loves Hero`s Brother..........
but Hero`s Brother loves Heroine............
but Heroine loves Villain.
Finally two persons commit SUICIDE.
Guess WHO ?????????
.
.
.
.
.
.
.
.
.
The PRODUCER and The DIRECTOR.
Girls looking for software bridegrooms
A conversation abt the process of selecting a software bridegroom. Enjoy reading.
Vidhya: hey! what is the matter you have called up all of a sudden?
Nithya : do u remember that my parents gave my horoscope, to search for a suitable match, to many people? So many horoscopes of the groom has come.. in that 4-5 seems to match.. I don't know which one to select, I am confused because of it.
Vidhya: what is the confusion about?
Nithya: horoscopes of many software engineers have come. It seems now a days, the software guys are wanting to marry girls in the other field. That's I why I don't know whom I must select among this. You are a software engineer na pls give me some suggestion .
vidhya: not a problem at all. So tell me the position that each one holds.
nithya: first is a manager.
vidhya: manager?? Then he will showcast himself that he is busy always. But he will not do anything properly. He will get u 1 kg of rice and ask you to prepare for the whole area say a village. He will get you mutton and ask you to prepare chicken 65. Even if you protest telling you can't make it, he'll not accept. He will tell you to work hard day and night to prepare it. He will also tell he'll provide you with the night cab. Even if you ask how can I prepare chicken 65 out of it by sitting day and night he will not accept.
nithya: ohh..so dangerous he is!! Then I must escape. Next is a test engineer.
vidhya: he is more dangerous than the other person. Whatever you do he will correctly tell only the fault in it. Even if you try to surprise him with 10 variety of food, he will tell the item which does not have salt in it. If you ask him "will you not at least tell that it is good", he will reply back saying it is your duty to make it good so why must I tell that. He is sooo good ...
Nithya: then a NOto him also. Next is the performance test engineer.
vidhya: he is another specimen.. even if everything is good, he will ask why did it take this much time. If you take 10 minutes to make a coffee, he will question you asking why you have taken 10 min for a coffee which can be done within 5 min. Even if you say that he is talking about the instant coffee while you have made the filter coffee, he will not accept. The same will be with all the work you do. You must not think about this person if you want to do make up in your life !!!
Nithya: then! you mean to say that we should not marry software guys??
Vidhya: who said like that?? In software there is one more group. They are called the developers group. How much ever you hit them they will bear.
Nithya: then tell about them.
Vidhya: you don't have to do anything. They will do everything themselves. If we sit back and just boost them it is enough. But the problem with them is- they will say "I know it" whatever you ask them.
Even that is ok. They will bear how much ever you hit them but the condition is you must keep saying "you are too good" after hitting them every time.
Nithya: this is superb. Then we must search for this kind of a groom....
Browsers vs Political Parties in Andhra Pradesh
nternet Explorer - Telugu Desam Party
Once ruled the kingdom and now loosing its share in the browser market.
Mozilla Firefox - Congress
Addressing all the needs and understanding the low level requirements. Thus becoming popular day by day.
Opera - BJP
With eye candy interface and a major player in Indian Political Internet.
Google Chrome - Chiranjeevi's Praja Rajyam Party
Browser with very few facilties and one basic need - viewing webpages without any corruption
Konqueror - TRS (and all telengana demanding parties)
Main dependancy is to run on a seperate Linux KDE - Kindly Divert Everyone
Epiphany - CPM
One man army running alone on the concept of socialism.
Letter from Banta Singh Bill Gates
Subject: Problems with my new computer
Dear Mr. Bill Gates,
We have bought a computer for our home and we have found some problems, which I want to bring to your notice.
1. There is a button 'start' but there is no "stop" button. We request you to check this.
2. We find there is 'Run' in the menu. One of my friends clicked 'run' he ran up to Amritsar ! So, we request you to change that to "sit", so that we can click that by sitting.
3. One doubt is whether any 're-scooter' is available in system? I find only 're-cycle', but I own a scooter at my home.
4. There is 'Find' button but it is not working properly. My wife lost the door key and we tried a lot trace the key with this ' find' button, but was unable to trace. Please rectify this problem.
5. My child learnt 'Microsoft word' now he wants to learn 'Microsoft sentence', so when you will provide that?
6. I bought computer, CPU, mouse and keyboard, but there is only one icon which shows 'MY Computer': when you will provide the remaining items?
7. It is surprising that windows says 'MY Pictures' but there is not even a single photo of mine. So when will you keep my photo in that.
8. There is 'MICROSOFT OFFICE' what about 'MICROSOFT HOME' since I use the PC at home only.
9. You provided "My Recent Documents". When you will provide "My Past Documents"?
10. You provide "My Network Places". For God sake please do not provide "My Secret Places". I do not want to let my wife know where I go after my office hours.
11. Last one from me to Mr Bill Gates :
Sir, how is it that your name is Gates but u are selling WINDOWS?
Yours obediently,
Banta Singh
Punjab
Side effects of working in the IT sector
Bhavik:
I once went out to the market wearing my ID card and did not realize till my friend told me why I was wearing it !!!!
Ashok:
Few days back I slept at 11:30 in the ni8 and woke up in the morning at 7:00 and suddenly thought that I haven't completed 9.15 hours and laughed at myself when I realised abt that.
Jyotsna:
One from me too...
Just after our training completion in Mysore Dc and postings to Pune, me and my friends went out for dinner in one of the best restaurants. .
And as I finished.. I started walking towards the Basin with plates in my hand.. :)
Abhijeet:
Jus to add...
Once I was on call with my father and mom was not around. I went on to ask, "why is she not attending the status call?"
Anup:
I don't login to orkut, yahoo, gmail, youtube, etc.. at my personal internet connection at home... thinking it will be blocked any way.
Till I realize - I am at home.
Rohit:
Yeah sometimes it do happens with me also........ ....while writing personal mails also........ .I jus use the way as if I am writing to onsite or some senior person...... ..
Jus forget that we are jus mailing our friends..... .........
And keeping hands in front of tap for waiting water to drop by itself is very frequent with me.......... .....I jus forget that we have to turn on and off the tap......... ..
Nidhi:
Awesome!!
Once after talking to one of my friend. I ended the conversation saying ..." Ok bye...in case of any issues will call u back"
(Hilarious!)
Nisha:
Sometimes when I mistakenly delete a message
from my mobile, I hope for a second, maybe its in the recycle bin
Farina:
I was about to throw my hanky into the bin after drying my hand.
Bhabani:
Once I was flashing my ID card instead of unlocking the door with the keys.
Nisha:
Kinda a same experience for me too..
I gave my office mail id and pwd to access Gmail and wondered when did they become invalid???
Sandy:
I have a experience to share tooo .. I was earlier working at the back office of an international Bank. We used to 'dispatch' lot of Credit / Debit cards and statements for the customers and track its delivery later.
Once my granma was admitted in a hospital, my team mate once casually asked me " howz ur granma doing now ? still in hospital ? " ... and i replied to her " She is better now , she will dispatched from the hospital tomorrow !"
This was followed by a loud laugh in the entire bay !
Sandeep:
Once I went to a pharmacy n asked for a tab....pharmacist asked whr I want 250mg r 500mg.....suddenly I replied as 256mg...lol. ...thank god he didn't noticed tht....
Ashwin:
Me getting a thought of doing an Alt+Tab while switching from a news channel to the DVD while watching TV.
Vidyarthi:
And I - after a forty hour marathon in Bhubaneshwar with Powerbuilder, decided to take a break and went to a movie. In the middle of the movie, when I wanted to check the time, I kept repeatedly glancing at the bottom right corner of the silver screen!
Venu:
Few of my friends and myself decided to go out for dinner. The place wasn't fixed yet. I said we shall decide it "run time"
Krishna:
When I went to a movie theatre from office directly.. I showed the guy at the entrance my ID card and walked in... he had to call me back asking the ticket...
Rama:
One late night when I went home after work, I was trying to flash my id card to open the lock and only after few secs, I realised what i'm trying to do
Sridhar:
Once I went to have juice at the local juice vendor and innocuously asked him whether he had a plain 'version' of lemonade.
Arun:
Few years back my shogun engine stopped on Bangalore MG Road as the petrol came to reserve. I told my friend I need to restart my bike!
Satya:
The other day I was hearing one guy talking of a "Standalone" house.. when he was actually intending a independent house... Poor broker shud have tuff time trying to find a " Alone house standing in a huge empty area... " don't know what interpretations the guy must have made.
Joke
1) MR. BEAN SEES A DOCTOR:
Doctor : I regret to tell you that you have a brain tumour.
Mr. Bean : Yesss!!! (jumps in joy)
Doctor : Did you understand what I just told you?
Mr. Bean : Yes of course, do you think I’m dumb?
Doctor : Then why are you so happy?
Mr. Bean : Because that proves that I have a brain!
2) MR. BEAN WHILE IN GRADE SCHOOL:
Teacher : What is 5 plus 4?
Mr. Bean : 9
Teacher : What is 4 plus 5?
Mr. Bean : Are you trying to fool me, you’ve just twisted the figure, the answer is 6!!
3) WHILE IN A DRUG STORE:
Mr. Bean : I’d like some vitamins for my grandson.
Clerk : Sir, vitamin A, B or C?
Mr. Bean : Any will do, my grandson doesn’t know the alphabet yet!!
4) AT AN ATM MACHINE:
Friend : What are you looking at?
Mr. Bean : I know your PIN no., hee, hee.
Friend : Alright, what is my PIN no. if you saw it?
Mr. Bean : four asterisks (****)!
5) MARRIAGE:
Friend : How many women do you believe must a man marry?
Mr. Bean : 16
Friend : Why?
Mr. Bean : Because the priest says 4 richer, 4 poorer, 4 better and 4 worse.
6) CHATTING WITH HIS FRIEND:
Friend : How was the tape you borrowed from me, is it Ok?
Mr. Bean : What do you mean ok, I thought it’s a horror film. I didn’t see any picture.
Friend : What tape did you take anyway?
Mr. Bean : Head Cleaner.
7) DEATH OF HIS MOTHER:
Mr. Bean crying) the
doctor called, Mom’s dead.
Friend : condolence, my friend.
(After 2 minutes) Mr. Bean cries even louder
Friend : what now?
Mr. Bean : my sister just called, her mom died too!
MR. BEAN ATTENDING A MEETING:
Colleague : Sorry I’m late. I got stuck in an elevator for 4 hrs because of a power failure.
Mr. Bean : That’s alright, me too…I got stuck on the escalator for 3 hrs.
9) SPELLING LESSON:
Mr. Bean’s Son: Dad, what is the spelling of successful….is it one c or two c?
Mr. Bean : Make it three c to be sure!
Exchange Data More Securely with XML Signatures and Encryption
A simple document:
<docRoot> <a>Hello</a> <b>World</b> </docRoot>
<docRoot> <a>Hello</a> <b>World</b> <Signature xmlns="http://www.w3c.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3c.org/TR/2001/REC-xml-c14n-20010315"/> <SignatureMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#rsa-sha1"/> <Reference URI=""> <Transforms> <Transform Algorithm= "http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> </Transforms> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1"/> <DigestValue>cbPT0951Ghb2G3UjpVjWw+7q0Bc=</DigestValue> </Reference> </SignedInfo> <SignatureValue>IoEwS(3 lines of Base64 text)XSo=</SignatureValue> </Signature> </docRoot>
- Apply each transform algorithm specified in the Transform elements to the data for the Reference, in the order the transforms appear under the Transforms element.
- Hash the transformed data using the hashing algorithm specified by the DigestMethod element of the Reference.
- Store the resulting hash value in the DigestValue element of the Reference.
- Apply each transform algorithm specified in the Transform elements of the Reference to the data for the Reference, in the order the transforms appear under the Transforms element.
- Hash the transformed data for the reference using the hashing algorithm that is specified by the DigestMethod element of the reference.
- Compare the hash value computed with the value stored in the DigestValue element.
using System.Security.Cryptography; using System.Security.Cryptography.Xml; // Also, add a reference to System.Security.dll // Load the signed data XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.Load("data-signed.xml"); // Find the Signature element in the document XmlNamespaceManager nsm = new XmlNamespaceManager(new NameTable()); nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl); XmlElement sigElt = (XmlElement)doc.SelectSingleNode( "//dsig:Signature", nsm); // Load the signature for verification SignedXml sig = new SignedXml(doc); sig.LoadXml(sigElt); // Verify the signature, assume the public key part of the // signing key is in the key variable if (sig.CheckSignature(key)) Console.WriteLine("Signature verified"); else Console.WriteLine("Signature not valid");
using System.Security.Cryptography; using System.Security.Cryptography.Xml; // Also, add a reference to System.Security.dll // Assume the data to sign is in the data.xml file, load it, and // set up the signature object. XmlDocument doc = new XmlDocument(); doc.Load("data.xml"); SignedXml sig = new SignedXml(doc); // Make a random RSA key, and set it on the signature for signing. RSA key = new RSACryptoServiceProvider(); sig.SigningKey = key; // Create a Reference to the containing document, add the enveloped // transform, and then add the Reference to the signature Reference refr = new Reference(""); refr.AddTransform(new XmlDsigEnvelopedSignatureTransform()); sig.AddReference(refr); // Compute the signature, add it to the XML document, and save sig.ComputeSignature(); doc.DocumentElement.AppendChild(sig.GetXml()); doc.Save("data-signed.xml");
<Reference URI="http://www.example.com/foo.jpg"> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1" /> <DigestValue>cbPT0951Ghb2G3UjpVjWw+7q0Bc=</DigestValue> </Reference>
// Create a Reference to detached data, assume a SignedXml object in sig Reference refr = new Reference("http://www.example.com/foo.jpg"); sig.AddReference(refr);
<Reference URI="#myData"> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1" /> <DigestValue>cbPT0951Ghb2G3UjpVjWw+7q0Bc=</DigestValue> </Reference>
<Object Id="myData">Your XML goes here</Object>
// Create a Reference to XML data in the containing document, // assume a SignedXml object in sig Reference refr = new Reference("#myData"); sig.AddReference(refr);
// Adds a DataObject with an Id of "#myData" to the signature, assume a // SignedXml object in sig, and xml data of type XmlNodeList in data DataObject dobj = new DataObject(); dobj.Id = "myData"; // Note: no # dobj.Data = data; // XML Data of the Object sig.AddObject(dobj);
- Any canonicalization algorithm can be used as a transform.
- The Base64 transform allows you to decode data in the Base64 encoding.
- The XSLT transform allows you to apply an XSLT stylesheet to XML data before signing it. The XSLT stylesheet to be applied is specified as XML under the Transform element.
- The XPath transform allows you to filter XML data with an XPath expression.
<a> <b>Some data</b> <c>More data</c> </a> <d> <b>Even more data</b> </d>
<b>Some data</b> <b>Even more data</b>
<Transform Algorithm="http://www.w3c.org/TR/1999/REC-xpath-19991116"> <XPath>ancestor-or-self::b</XPath> </Transform>
// Add an XPath transform to a reference. // Assume a Reference object in refr XmlDocument doc = new XmlDocument(); doc.LoadXml("<XPath>ancestor-or-self::b</XPath>"); XmlDsigXPathTransform xptrans = new XmlDsigXPathTransform(); xptrans.LoadInnerXml(doc.ChildNodes); refr.AddTransform(xptrans);
<root> <a >Some text</a> <b attr1="yes" attr2="no"></b> <c Id="foo">More text</c> </root> <root> <a>Some text</a> <b attr2="no" attr1="yes" /> <c Id="foo">More text</c> </root>
// Adds an KeyInfo element with RSA public key information to the // signature. // Assumes a SignedXml object in sig, and an RSA object in key. KeyInfo ki = new KeyInfo(); ki.AddClause(new RSAKeyValue(key)); sig.KeyInfo = ki;
<KeyInfo><KeyValue><RSAKeyValue> <Modulus>4LfG(2 lines of Base64 text)2Fr=</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue></KeyValue></KeyInfo>
// Verify a signature that includes RSAKeyInfo or DSAKeyInfo. // Assume a SignedXml object in sig. bool verified = sig.CheckSignature();
<docRoot> <a>Hello</a> <b>World</b> <Signature xmlns="http://www.w3c.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3c.org/TR/2001/REC-xml-c14n-20010315"/> <SignatureMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#rsa-sha1"/> <Reference URI=""> <Transforms> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped- signature"/> <Transform Algorithm="http://www.w3c.org/TR/1999/REC-xpath-19991116"> <XPath>ancestor-or-self::a</XPath> </Transform> </Transforms> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1"/> <DigestValue>mN4R0653F4ethOiTBeAu+7q0Be=</DigestValue> </Reference> </SignedInfo> <SignatureValue>X4Ie(3 lines of Base64 text)nP3=</SignatureValue> </Signature> </docRoot>
// This method checks the signature profile for the signature // in the supplied document. It ensures there is only one // Signature element and only one enveloped reference with only // one enveloped signature transform public bool CheckSignatureProfile(XmlDocument doc) { // Make sure there is only one Signature element XmlNamespaceManager nsm = new XmlNamespaceManager(new NameTable()); nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl); XmlNodeList sigList = doc.SelectNodes("//dsig:Signature", nsm); if (sigList.Count > 1) return false; //Wrong number of Signature elements //Make sure the Signature element has only one Reference XmlElement sigElt = (XmlElement)sigList[0]; XmlNodeList refList = sigElt.SelectNodes( "dsig:SignedInfo/dsig:Reference", nsm); if (refList.Count > 1) return false; //Wrong number of Reference elements // Make sure the Reference URI is "" XmlElement refElt = (XmlElement)refList[0]; XmlAttributeCollection refAttrs = refElt.Attributes; XmlNode uriAttr = refAttrs.GetNamedItem("URI"); if ((uriAttr == null) || (uriAttr.Value != "")) return false; // Wrong type of reference // Make sure the only tranform is the enveloped signature transform XmlNodeList transList = refElt.SelectNodes( "dsig:Transforms/dsig:Transform", nsm); if (transList.Count != 1) return false; //Wrong number of Transform elements XmlElement transElt = (XmlElement)transList[0]; string transAlg = transElt.GetAttribute("Algorithm"); if (transAlg != SignedXml.XmlDsigEnvelopedSignatureTransformUrl) return false; //Wrong type of transform return true; }
<root> <myData1>Some Data</myData1> <myData2>More data</myData2> <Signature xmlns="http://www.w3c.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3c.org/TR/2001/REC-xml-c14n-20010315"/> <SignatureMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#rsa-sha1"/> <Reference URI=""> <Transforms> <Transform Algorithm= "http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> </Transforms> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1"/> <DigestValue>cbPT0951Ghb2G3UjpVjWw+7q0Bc=</DigestValue> </Reference> <Reference URI="#signer"> <Transforms> <Transform Algorithm= "http://www.w3c.org/TR/1999/REC-xpath-19991116"> <XPath xmlns:my="http://example"> ancestor-or-self::my:SignerID </XPath> </Transform> </Transforms> <DigestMethod Algorithm="http://www.w3c.org/2000/09/xmldsig#sha1"/> <DigestValue>mN4R0653F4ethOiTBeAu+7q0Be</DigestValue> </Reference> </SignedInfo> <SignatureValue>IoEwS...</SignatureValue> <KeyInfo> <KeyValue> <RSAKeyValue> <Modulus>4LfG(2 lines of Base64 text)2Fr=</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> <Object Id="signer"> <my:SignerData xmlns:my="http://example"> <my:SignerName>Mike</my:SignerName> <my:SignerID>4815</my:SignerID> </my:SignerData> </Object> </Signature> </root>
A simple document:
<docRoot> <a>Hello</a> <b>World</b> </docRoot>
<docRoot> <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#"> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <KeyName>recipient_public_key</KeyName> </KeyInfo> <CipherData> <CipherValue>PrI6(3 lines of Base64 text)Dwy4=</CipherValue> </CipherData> </EncryptedKey> </KeyInfo> <CipherData> <CipherValue>awcH(3 lines of Base64 text)NNqQ=</CipherValue> </CipherData> </EncryptedData> </docRoot>
URI Properties of EncryptedXml Class | Encrypting Data | Encrypting Keys | |
---|---|---|---|
AES | XmlEncAES256Url | ||
XmlEncAES256KeyWrapUrl | |||
DES | XmlEncDESUrl | ||
TripleDES | XmlEncTripleDESUrl | ||
XmlEncTripleDESKeyWrapUrl | |||
RSA | XmlEncRSA1_5Url |
CipherReference Location | URI Format | Cipher Text Format |
---|---|---|
Same document | #order | Base64 string |
Remote Web site | http://www.example.com/order.bin | Binary |
// Create evidence based on the referring document Evidence evidence = new Evidence(); evidence.AddHost(new Zone(SecurityZone.Internet)); evidence.AddHost(new Site("untrustedsite")); evidence.AddHost(new Url("untrustedsite/encrypted.xml")); EncryptedXml exml = new EncryptedXml(untrustedDoc, evidence);
<order> <purchase> <item quantity="1">Def Leppard: Pyromania</item> <item quantity="1">Ozzy Osbourne: Goodbye to Romance</item> </purchase> <shipping> <to>Shawn Farkas</to> <street>One Microsoft Way</street> <zip>98052</zip> </shipping> <payment> <card type="visa">0000-0000-0000-0000</card> </payment> </order>
// Assumes the order is in the order.xml file. XmlDocument doc = new XmlDocument(); doc.Load("order.xml"); EncryptedXml exml = new EncryptedXml(doc);
// Set up the key mapping. Assumes a method called GetBillingKey // that returns the RSA key for the billing department. RSA billingKey = GetBillingKey(); exml.AddKeyNameMapping("billing", billingKey);
// Find the element to encrypt. XmlElement paymentElement = doc.SelectSingleNode("//order/payment") as XmlElement; // Encrypt the payment element, passing in the key name. EncryptedData encryptedPayment = exml.Encrypt(paymentElement, "billing"); // Swap the encrypted element for the unencrypted element. EncryptedXml.ReplaceElement(paymentElement, encryptedPayment, true);
<order> <purchase> <item quantity="1">Def Leppard: Pyromania</item> <item quantity="1">Ozzy Osbourne: Goodbye to Romance</item> </purchase> <shipping> <to>Shawn Farkas</to> <street>One Microsoft Way</street> <zip>98052</zip> </shipping> <payment> <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#"> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/ xmlenc#aes256-cbc" /> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/ xmlenc#kw-aes256" /> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <KeyName>billing</KeyName> </KeyInfo> <CipherData> <CipherValue>Sce6lLD+u2f8HzPFyuGxTF32z4mb2ugql3JuJIPAqIP98iYs+Muhqg== </CipherValue> </CipherData> </EncryptedKey> </KeyInfo> <CipherData> <CipherValue>FXKC(3 lines of Base64 text)ApqQt</CipherValue> </CipherData> </EncryptedData> </payment> </order>
// Assumes the encrypted order is in encrypted.xml XmlDocument doc = new XmlDocument("encrypted.xml"); EncryptedXml exml = new EncryptedXml(doc, documentEvidence);
// Set up the key mapping. Assumes a method called GetBillingKey // that returns the RSA key for the billing department. RSA billingKey = GetBillingKey(); exml.AddKeyNameMapping("billing", billingKey);
// Decrypt the encrypted XML in the document exml.DecryptDocument();
// Use the private key from the certificate. Assumes a SignedXml // object in sig and an X509CertificateEx object in cert. sig.SigningKey = cert.PrivateKey;
// Add X.509 certificate info to the KeyInfo element. Assumes a // SignedXml object in sig and an X509CertificateEx in cert. KeyInfoX509Data keyInfoX509 = new KeyInfoX509Data(cert, X509IncludeOption.EndCertOnly); sig.KeyInfo.AddClause(keyInfoX509);
// Check the signature against the cert and verify the cert. Assumes a // SignedXml object in sig and an X509CertificateEx object in cert. bool verified = sig.CheckSignature(cert, true);
Class | Description |
---|---|
XmlDecryptionTransform | Decrypts encrypted XML |
XmlDsigBase64Transform | Decodes base64 encoded data |
XmlDsigC14NTransform | Performs C14N canonicalization (see http://www.w3.org/TR/xml-c14n for more information) |
XmlDsigEnvelopedSignatureTransform | Removes an enveloped signature from a document |
XmlDsigExcC14NTransform | Performs exclusive C14N canonicalization (see http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718 for more information) |
XmlDsigXPathTransform | Applies an XPath filter to the input XML |
XmlDsigXsltTransform | Applies an XSLT transform to the input XML |
XmlLicenseTransform | Implements the LTA transform |
XmlDsigC14NWithCommentsTransform | Performs C14N canonicalization, but leaves comments in the canonicalized XML |
XmlDsigExcC14NWithCommentsTransform | Performs exclusive C14N canonicalization, but leaves comments in the canonicalized XML |